omegon 0.6.0

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.
Files changed (160) hide show
  1. package/.gitattributes +3 -0
  2. package/AGENTS.md +16 -0
  3. package/LICENSE +15 -0
  4. package/README.md +289 -0
  5. package/bin/pi.mjs +30 -0
  6. package/extensions/00-secrets/index.ts +1126 -0
  7. package/extensions/01-auth/auth.ts +401 -0
  8. package/extensions/01-auth/index.ts +289 -0
  9. package/extensions/auto-compact.ts +42 -0
  10. package/extensions/bootstrap/deps.ts +291 -0
  11. package/extensions/bootstrap/index.ts +811 -0
  12. package/extensions/chronos/chronos.sh +487 -0
  13. package/extensions/chronos/index.ts +148 -0
  14. package/extensions/cleave/assessment.ts +754 -0
  15. package/extensions/cleave/bridge.ts +31 -0
  16. package/extensions/cleave/conflicts.ts +250 -0
  17. package/extensions/cleave/dispatcher.ts +808 -0
  18. package/extensions/cleave/guardrails.ts +426 -0
  19. package/extensions/cleave/index.ts +3121 -0
  20. package/extensions/cleave/lifecycle-emitter.ts +20 -0
  21. package/extensions/cleave/openspec.ts +811 -0
  22. package/extensions/cleave/planner.ts +260 -0
  23. package/extensions/cleave/review.ts +579 -0
  24. package/extensions/cleave/skills.ts +355 -0
  25. package/extensions/cleave/types.ts +261 -0
  26. package/extensions/cleave/workspace.ts +861 -0
  27. package/extensions/cleave/worktree.ts +243 -0
  28. package/extensions/core-renderers.ts +253 -0
  29. package/extensions/dashboard/context-gauge.ts +58 -0
  30. package/extensions/dashboard/file-watch.ts +14 -0
  31. package/extensions/dashboard/footer.ts +1145 -0
  32. package/extensions/dashboard/git.ts +185 -0
  33. package/extensions/dashboard/index.ts +478 -0
  34. package/extensions/dashboard/memory-audit.ts +34 -0
  35. package/extensions/dashboard/overlay-data.ts +705 -0
  36. package/extensions/dashboard/overlay.ts +365 -0
  37. package/extensions/dashboard/render-utils.ts +54 -0
  38. package/extensions/dashboard/types.ts +191 -0
  39. package/extensions/dashboard/uri-helper.ts +45 -0
  40. package/extensions/debug.ts +69 -0
  41. package/extensions/defaults.ts +282 -0
  42. package/extensions/design-tree/dashboard-state.ts +161 -0
  43. package/extensions/design-tree/design-card.ts +362 -0
  44. package/extensions/design-tree/index.ts +2130 -0
  45. package/extensions/design-tree/lifecycle-emitter.ts +41 -0
  46. package/extensions/design-tree/tree.ts +1607 -0
  47. package/extensions/design-tree/types.ts +163 -0
  48. package/extensions/distill.ts +127 -0
  49. package/extensions/effort/index.ts +395 -0
  50. package/extensions/effort/tiers.ts +146 -0
  51. package/extensions/effort/types.ts +105 -0
  52. package/extensions/lib/git-state.ts +227 -0
  53. package/extensions/lib/local-models.ts +157 -0
  54. package/extensions/lib/model-preferences.ts +51 -0
  55. package/extensions/lib/model-routing.ts +720 -0
  56. package/extensions/lib/operator-fallback.ts +205 -0
  57. package/extensions/lib/operator-profile.ts +360 -0
  58. package/extensions/lib/slash-command-bridge.ts +253 -0
  59. package/extensions/lib/typebox-helpers.ts +16 -0
  60. package/extensions/local-inference/index.ts +727 -0
  61. package/extensions/mcp-bridge/README.md +220 -0
  62. package/extensions/mcp-bridge/index.ts +951 -0
  63. package/extensions/mcp-bridge/lib.ts +365 -0
  64. package/extensions/mcp-bridge/mcp.json +3 -0
  65. package/extensions/mcp-bridge/package.json +11 -0
  66. package/extensions/model-budget.ts +752 -0
  67. package/extensions/offline-driver.ts +403 -0
  68. package/extensions/openspec/archive-gate.ts +164 -0
  69. package/extensions/openspec/branch-cleanup.ts +64 -0
  70. package/extensions/openspec/dashboard-state.ts +50 -0
  71. package/extensions/openspec/index.ts +1917 -0
  72. package/extensions/openspec/lifecycle-emitter.ts +65 -0
  73. package/extensions/openspec/lifecycle-files.ts +70 -0
  74. package/extensions/openspec/lifecycle.ts +50 -0
  75. package/extensions/openspec/reconcile.ts +187 -0
  76. package/extensions/openspec/spec.ts +1385 -0
  77. package/extensions/openspec/types.ts +98 -0
  78. package/extensions/project-memory/DESIGN-global-mind.md +198 -0
  79. package/extensions/project-memory/README.md +202 -0
  80. package/extensions/project-memory/api-types.ts +382 -0
  81. package/extensions/project-memory/compaction-policy.ts +29 -0
  82. package/extensions/project-memory/core.ts +164 -0
  83. package/extensions/project-memory/embeddings.ts +230 -0
  84. package/extensions/project-memory/extraction-v2.ts +861 -0
  85. package/extensions/project-memory/factstore.ts +2177 -0
  86. package/extensions/project-memory/index.ts +3459 -0
  87. package/extensions/project-memory/injection-metrics.ts +91 -0
  88. package/extensions/project-memory/jsonl-io.ts +12 -0
  89. package/extensions/project-memory/lifecycle.ts +331 -0
  90. package/extensions/project-memory/migration.ts +293 -0
  91. package/extensions/project-memory/package.json +9 -0
  92. package/extensions/project-memory/sci-renderers.ts +7 -0
  93. package/extensions/project-memory/template.ts +103 -0
  94. package/extensions/project-memory/triggers.ts +52 -0
  95. package/extensions/project-memory/types.ts +102 -0
  96. package/extensions/render/composition/fonts/Inter-Bold.ttf +0 -0
  97. package/extensions/render/composition/fonts/Inter-Regular.ttf +0 -0
  98. package/extensions/render/composition/fonts/Tomorrow-Bold.ttf +0 -0
  99. package/extensions/render/composition/fonts/Tomorrow-Regular.ttf +0 -0
  100. package/extensions/render/composition/package-lock.json +534 -0
  101. package/extensions/render/composition/package.json +22 -0
  102. package/extensions/render/composition/render.mjs +246 -0
  103. package/extensions/render/composition/test-comp.tsx +87 -0
  104. package/extensions/render/composition/types.ts +24 -0
  105. package/extensions/render/excalidraw/UPSTREAM.md +81 -0
  106. package/extensions/render/excalidraw/elements.ts +764 -0
  107. package/extensions/render/excalidraw/index.ts +66 -0
  108. package/extensions/render/excalidraw/types.ts +223 -0
  109. package/extensions/render/excalidraw-renderer/pyproject.toml +8 -0
  110. package/extensions/render/excalidraw-renderer/render_excalidraw.py +182 -0
  111. package/extensions/render/excalidraw-renderer/render_template.html +59 -0
  112. package/extensions/render/index.ts +830 -0
  113. package/extensions/render/native-diagrams/index.ts +57 -0
  114. package/extensions/render/native-diagrams/motifs.ts +542 -0
  115. package/extensions/render/native-diagrams/raster.ts +8 -0
  116. package/extensions/render/native-diagrams/scene.ts +75 -0
  117. package/extensions/render/native-diagrams/spec.ts +204 -0
  118. package/extensions/render/native-diagrams/svg.ts +116 -0
  119. package/extensions/sci-ui.ts +304 -0
  120. package/extensions/session-log.ts +174 -0
  121. package/extensions/shared-state.ts +146 -0
  122. package/extensions/spinner-verbs.ts +91 -0
  123. package/extensions/style.ts +281 -0
  124. package/extensions/terminal-title.ts +191 -0
  125. package/extensions/tool-profile/index.ts +291 -0
  126. package/extensions/tool-profile/profiles.ts +290 -0
  127. package/extensions/types.d.ts +9 -0
  128. package/extensions/vault/index.ts +185 -0
  129. package/extensions/version-check.ts +90 -0
  130. package/extensions/view/index.ts +859 -0
  131. package/extensions/view/uri-resolver.ts +148 -0
  132. package/extensions/web-search/index.ts +182 -0
  133. package/extensions/web-search/providers.ts +121 -0
  134. package/extensions/web-ui/index.ts +110 -0
  135. package/extensions/web-ui/server.ts +265 -0
  136. package/extensions/web-ui/state.ts +462 -0
  137. package/extensions/web-ui/static/index.html +145 -0
  138. package/extensions/web-ui/types.ts +284 -0
  139. package/package.json +76 -0
  140. package/prompts/init.md +75 -0
  141. package/prompts/new-repo.md +54 -0
  142. package/prompts/oci-login.md +56 -0
  143. package/prompts/status.md +50 -0
  144. package/settings.json +4 -0
  145. package/skills/cleave/SKILL.md +218 -0
  146. package/skills/git/SKILL.md +209 -0
  147. package/skills/git/_reference/ci-validation.md +204 -0
  148. package/skills/oci/SKILL.md +338 -0
  149. package/skills/openspec/SKILL.md +346 -0
  150. package/skills/pi-extensions/SKILL.md +191 -0
  151. package/skills/pi-tui/SKILL.md +517 -0
  152. package/skills/python/SKILL.md +189 -0
  153. package/skills/rust/SKILL.md +268 -0
  154. package/skills/security/SKILL.md +206 -0
  155. package/skills/style/SKILL.md +264 -0
  156. package/skills/typescript/SKILL.md +225 -0
  157. package/skills/vault/SKILL.md +102 -0
  158. package/themes/alpharius-legacy.json +85 -0
  159. package/themes/alpharius.conf +59 -0
  160. package/themes/alpharius.json +88 -0
package/.gitattributes ADDED
@@ -0,0 +1,3 @@
1
+ # Memory sync: keep all lines from both sides on merge.
2
+ # importFromJsonl deduplicates by content_hash, so redundant lines are harmless.
3
+ .pi/memory/facts.jsonl merge=union
package/AGENTS.md ADDED
@@ -0,0 +1,16 @@
1
+ # Omegon Project Directives
2
+
3
+ > Global directives (attribution, completion standards, memory sync, branch hygiene) are deployed automatically to `~/.pi/agent/AGENTS.md` by the defaults extension on first session start. They apply to all projects. To customize, edit that file — but remove the `<!-- managed by Omegon -->` marker or your changes will be overwritten on update.
4
+
5
+ ## Contributing
6
+
7
+ This repo follows trunk-based development on `main`. The full policy is in `CONTRIBUTING.md` — read it with the `read` tool if you need branch naming conventions, the memory sync architecture details, or scaling guidance.
8
+
9
+ Key points for working on Omegon itself:
10
+
11
+ - **Direct commits to `main`** for single-file fixes, typos, config tweaks
12
+ - **Feature branches** (`feature/<name>`, `refactor/<name>`) for multi-file or multi-session work
13
+ - **Conventional commits** required — see `skills/git/SKILL.md` for the spec
14
+ - The `.gitattributes` in this repo declares `merge=union` for `.pi/memory/facts.jsonl`
15
+ - The `.pi/.gitignore` excludes `memory/*.db` files — only `facts.jsonl` is tracked
16
+ - **Type checking**: `npx tsc --noEmit` must pass before committing TypeScript changes. Run `npm run typecheck` or `npm run check` (typecheck + tests).
package/LICENSE ADDED
@@ -0,0 +1,15 @@
1
+ ISC License
2
+
3
+ Copyright (c) 2026 Chris Wilson
4
+
5
+ Permission to use, copy, modify, and/or distribute this software for any
6
+ purpose with or without fee is hereby granted, provided that the above
7
+ copyright notice and this permission notice appear in all copies.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
10
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
11
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
12
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
13
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
14
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
15
+ PERFORMANCE OF THIS SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,289 @@
1
+ # Omegon
2
+
3
+ A batteries-included extension package for the pi coding agent. Adds persistent project memory, spec-driven development, local LLM inference, image generation, web search, parallel task decomposition, a live dashboard, and quality-of-life tools — all loadable with a single install.
4
+
5
+ ## Installation
6
+
7
+ Omegon runs on top of a patched fork of the pi coding agent (`@cwilson613/pi-coding-agent`). The fork is published to npm and tracks upstream [`badlogic/pi-mono`](https://github.com/badlogic/pi-mono) daily, adding targeted fixes for OAuth login reliability and bracketed-paste input handling.
8
+
9
+ **Step 1 — Install the pi binary from the patched fork:**
10
+
11
+ ```bash
12
+ npm install -g @cwilson613/pi-coding-agent
13
+ ```
14
+
15
+ **Step 2 — Install Omegon extensions:**
16
+
17
+ ```bash
18
+ pi install https://github.com/cwilson613/omegon
19
+ ```
20
+
21
+ **Step 3 — First-time setup:**
22
+
23
+ ```bash
24
+ pi # start pi in any project directory
25
+ /bootstrap # check deps, install missing tools, configure preferences
26
+ ```
27
+
28
+ ### Keeping up to date
29
+
30
+ | What to update | How |
31
+ |----------------|-----|
32
+ | **Omegon extensions** | `/update` or `pi update` (tracks `main` branch) |
33
+ | **pi binary** | `/update-pi` — checks npm for latest `@cwilson613/pi-coding-agent`, prompts before installing |
34
+
35
+ > The patched fork syncs from upstream daily via GitHub Actions. Bug fixes and new AI provider support land automatically. If a sync PR has conflicts, they are surfaced for manual review before merging — upstream changes are never silently dropped.
36
+
37
+ > **Note:** `pi install` and `pi update` track the `main` branch. The version-check extension notifies you when a new Omegon release is available.
38
+
39
+ ## Architecture
40
+
41
+ ![Omegon Architecture](docs/img/architecture.png)
42
+
43
+ Omegon extends `@cwilson613/pi-coding-agent` with **27 extensions**, **12 skills**, and **4 prompt templates** — loaded automatically on session start.
44
+
45
+ ### Development Methodology
46
+
47
+ Omegon enforces **spec-first development** for non-trivial changes:
48
+
49
+ ![Spec-Driven Pipeline](docs/img/spec-pipeline.png)
50
+
51
+ The full lifecycle: **design → propose → spec → plan → implement → verify → archive**. Given/When/Then scenarios are the source of truth for correctness — code implements the specs, not the reverse.
52
+
53
+ ## Extensions
54
+
55
+ ### 📋 OpenSpec
56
+
57
+ Spec-driven development lifecycle — proposal → specs → design → tasks workflow with delta-spec merge on archive.
58
+
59
+ - **Tool**: `openspec_manage`
60
+ - **Commands**: `/opsx:propose`, `/opsx:spec`, `/opsx:ff`, `/opsx:status`, `/opsx:verify`, `/opsx:archive`, `/opsx:sync`
61
+ - **Lifecycle stages**: proposed → specified → planned → implementing → verifying → archived
62
+ - **API contracts**: When a change involves a network API, derives an OpenAPI 3.1 spec from Given/When/Then scenarios; `/assess spec` validates implementation against it
63
+ - Integrates with [OpenSpec CLI](https://github.com/Fission-AI/OpenSpec) profiles
64
+
65
+ ### 🪓 Cleave
66
+
67
+ Parallel task decomposition with dependency-ordered wave dispatch in isolated git worktrees.
68
+
69
+ - **Tools**: `cleave_assess` (complexity evaluation), `cleave_run` (parallel dispatch)
70
+ - **Commands**: `/cleave <directive>`, `/assess cleave`, `/assess diff`, `/assess spec`
71
+ - **OpenSpec integration**: Uses `tasks.md` as the split plan when `openspec/` exists, enriches child tasks with design decisions and spec acceptance criteria, reconciles task completion on merge, guides through verify → archive
72
+ - **Skill-aware dispatch**: Auto-matches skill files to children based on file scope patterns (e.g. `*.py` → python, `Containerfile` → oci). Annotations (`<!-- skills: python, k8s -->`) override auto-matching
73
+ - **Model tier routing**: Each child resolves an execution tier — explicit annotation > skill-based hint > default. Provider-neutral tier labels resolve to concrete models through the session routing policy
74
+ - **Adversarial review loop** (opt-in via `review: true`): After each child completes, an opus-tier reviewer checks for bugs, security issues, and spec compliance. Severity-gated: nits→accept, warnings→1 fix iteration, criticals→2 fixes then escalate, security→immediate escalate. Churn detection bails when >50% of issues reappear between rounds
75
+ - **Large-run preflight**: Asks which provider to favor before expensive dispatches, preventing mid-run subscription exhaustion
76
+
77
+ ### 🌲 Design Tree
78
+
79
+ Structured design exploration with persistent markdown documents — the upstream of OpenSpec.
80
+
81
+ - **Tools**: `design_tree` (query), `design_tree_update` (create/mutate nodes)
82
+ - **Commands**: `/design list`, `/design new`, `/design update`, `/design branch`, `/design decide`, `/design implement`
83
+ - **Document structure**: Frontmatter (status, tags, dependencies, priority, issue_type, open questions) + sections (Overview, Research, Decisions, Open Questions, Implementation Notes)
84
+ - **Work triage**: `design_tree(action="ready")` returns all decided, dependency-resolved nodes sorted by priority — the session-start "what next?" query
85
+ - **Blocked audit**: `design_tree(action="blocked")` returns all stalled nodes with each blocking dependency's id, title, and status
86
+ - **Priority**: `set_priority` (1 = critical → 5 = trivial) on any node; `ready` auto-sorts by it
87
+ - **Issue types**: `set_issue_type` classifies nodes as `epic | feature | task | bug | chore` — bugs and chores are now first-class tracked work
88
+ - **OpenSpec bridge**: `design_tree_update` with `action: "implement"` scaffolds `openspec/changes/<node-id>/` from a decided node's content; `/cleave` executes it
89
+ - **Full pipeline**: design → decide → implement → `/cleave` → `/assess spec` → archive
90
+
91
+ ### 🧠 Project Memory
92
+
93
+ Persistent, cross-session knowledge stored in SQLite. Accumulates architectural decisions, constraints, patterns, and known issues — retrieved semantically each session.
94
+
95
+ - **11 tools**: `memory_store`, `memory_recall`, `memory_query`, `memory_supersede`, `memory_archive`, `memory_connect`, `memory_compact`, `memory_episodes`, `memory_focus`, `memory_release`, `memory_search_archive`
96
+ - **Semantic retrieval**: Embedding-based search via Ollama (`qwen3-embedding`), falls back to FTS5 keyword search
97
+ - **Background extraction**: Auto-discovers facts from tool output without interrupting work
98
+ - **Episodic memory**: Generates session narratives at shutdown for "what happened last time" context
99
+ - **Global knowledge base**: Cross-project facts at `~/.pi/memory/global.db`
100
+ - **Git sync**: Exports to JSONL for version-controlled knowledge sharing across machines
101
+
102
+ ![Memory Lifecycle](docs/img/memory-lifecycle.png)
103
+
104
+ ### 📊 Dashboard
105
+
106
+ Live status panel showing design tree, OpenSpec changes, cleave dispatch, and git branches at a glance.
107
+
108
+ - **Commands**: `/dash` (toggle compact ↔ raised), `/dashboard` (open side panel)
109
+ - **Compact mode**: Single footer line — design/openspec/cleave summaries + context gauge
110
+ - **Raised mode**: Full-width expanded view (toggle with `/dash`)
111
+ - Git branch tree rooted at repo name, annotated with linked design nodes
112
+ - Two-column split at ≥120 terminal columns: design tree + cleave left, OpenSpec right
113
+ - Context gauge · model · thinking level in shared footer zone
114
+ - No line cap — renders as much content as needed
115
+ - **Keyboard**: `Ctrl+Shift+B` toggles raised/compact
116
+
117
+ ### 🌐 Web UI
118
+
119
+ Localhost-only, read-only HTTP dashboard that exposes live control-plane state as JSON. It binds to `127.0.0.1`, is not started automatically, and serves no mutation endpoints in the MVP.
120
+
121
+ - **Command**: `/web-ui [start|stop|status|open]`
122
+ - **Shell**: polling-first HTML dashboard
123
+ - **Endpoints**: `GET /api/state`, plus slice routes `/api/session`, `/api/dashboard`, `/api/design-tree`, `/api/openspec`, `/api/cleave`, `/api/models`, `/api/memory`, `/api/health`
124
+ - **State contract**: versioned `ControlPlaneState` (schema v1)
125
+
126
+ ### ⚔️ Effort Tiers
127
+
128
+ Single global knob controlling the inference intensity across the entire harness. Seven named tiers using provider-neutral labels — tier labels resolve to concrete model IDs from whichever provider (Anthropic or OpenAI) the session routing policy prefers.
129
+
130
+ | Tier | Name | Driver | Thinking | Review |
131
+ |------|------|--------|----------|--------|
132
+ | 1 | **Servitor** | local | off | local |
133
+ | 2 | **Average** | local | minimal | local |
134
+ | 3 | **Substantial** | sonnet | low | sonnet |
135
+ | 4 | **Ruthless** | sonnet | medium | sonnet |
136
+ | 5 | **Lethal** | sonnet | high | opus |
137
+ | 6 | **Absolute** | opus | high | opus |
138
+ | 7 | **Omnissiah** | opus | high | opus |
139
+
140
+ - `/effort <name>` — switch tier mid-session
141
+ - `/effort cap` — lock current tier as ceiling; agent cannot self-upgrade past it
142
+ - `/effort uncap` — remove ceiling lock
143
+ - Affects: driver model, thinking level, extraction, compaction, cleave child floor, review model
144
+
145
+ ### 🤖 Local Inference
146
+
147
+ Delegate sub-tasks to locally running LLMs via Ollama — zero API cost.
148
+
149
+ - **Tools**: `ask_local_model`, `list_local_models`
150
+ - **Commands**: `/local-models`, `/local-status`
151
+ - Auto-discovers available models on session start
152
+
153
+ ### 🔌 Offline Driver
154
+
155
+ Switch the driving model from cloud to a local Ollama model when connectivity drops or for fully offline operation.
156
+
157
+ - **Tool**: `switch_to_offline_driver`
158
+ - Auto-selects best available model from a hardware-aware preference list
159
+ - Model registry in `extensions/lib/local-models.ts` — one file to update when new models land
160
+ - Covers: 64GB (70B), 32GB (32B), 24GB (14B/MoE-30B), 16GB (8B), 8GB (4B)
161
+
162
+ ### 💰 Model Budget
163
+
164
+ Switch model tiers to match task complexity and conserve API spend. Tier labels are provider-neutral — resolved at runtime through the session routing policy.
165
+
166
+ - **Tool**: `set_model_tier` — `opus` / `sonnet` / `haiku` / `local`
167
+ - **Tool**: `set_thinking_level` — `off` / `minimal` / `low` / `medium` / `high`
168
+ - Downgrade for routine edits, upgrade for architecture decisions
169
+ - Respects effort tier cap — cannot upgrade past a locked ceiling
170
+
171
+ ### 🎨 Render
172
+
173
+ Generate images and diagrams directly in the terminal.
174
+
175
+ - **FLUX.1 image generation** via MLX on Apple Silicon — `generate_image_local`
176
+ - **D2 diagrams** rendered inline — `render_diagram`
177
+ - **Native SVG/PNG diagrams** for canonical motifs (pipeline, fanout, panel-split) — `render_native_diagram`
178
+ - **Excalidraw** JSON-to-PNG rendering — `render_excalidraw`
179
+
180
+ ### 🔍 Web Search
181
+
182
+ Multi-provider web search with deduplication.
183
+
184
+ - **Tool**: `web_search`
185
+ - **Providers**: Brave, Tavily, Serper (Google)
186
+ - **Modes**: `quick` (single provider, fastest), `deep` (more results), `compare` (all providers, best for research)
187
+
188
+ ### 🗂️ Tool Profiles
189
+
190
+ Enable or disable tools and switch named profiles to keep the context window lean.
191
+
192
+ - **Tool**: `manage_tools`
193
+ - **Command**: `/profile [name|reset]`
194
+ - Pre-built profiles for common workflows; per-tool enable/disable for fine-grained control
195
+
196
+ ### 📖 Vault
197
+
198
+ Markdown viewport for project documentation — serves docs with wikilink navigation and graph view.
199
+
200
+ - **Command**: `/vault`
201
+
202
+ ### 🔐 Secrets
203
+
204
+ Resolve secrets from environment variables, shell commands, or system keychains — without storing values in config.
205
+
206
+ - Declarative `@secret` annotations in extension headers
207
+ - Sources: `env:`, `cmd:`, `keychain:`
208
+
209
+ ### 🌐 MCP Bridge
210
+
211
+ Connect external MCP (Model Context Protocol) servers as native pi tools.
212
+
213
+ - Bridges MCP tool schemas into pi's tool registry
214
+ - Stdio transport for local MCP servers
215
+
216
+ ### 🔧 Utilities
217
+
218
+ | Extension | Description |
219
+ |-----------|-------------|
220
+ | `bootstrap` | First-time setup — check/install dependencies, capture operator preferences (`/bootstrap`, `/refresh`, `/update-pi`) |
221
+ | `chronos` | Authoritative date/time from system clock — eliminates AI date math errors |
222
+ | `01-auth` | Auth status, diagnosis, and refresh across git, GitHub, GitLab, AWS, k8s, OCI (`/auth`, `/whoami`) |
223
+ | `view` | Inline file viewer — images, PDFs, docs, syntax-highlighted code |
224
+ | `distill` | Context distillation for session handoff (`/distill`) |
225
+ | `session-log` | Append-only structured session tracking |
226
+ | `auto-compact` | Context pressure monitoring with automatic compaction |
227
+ | `defaults` | Deploys `AGENTS.md` and theme on first install; content-hash guard prevents overwriting customizations |
228
+ | `terminal-title` | Dynamic tab titles showing active cleave runs and git branch |
229
+ | `spinner-verbs` | Warhammer 40K-themed loading messages |
230
+ | `style` | Alpharius design system reference (`/style`) |
231
+ | `version-check` | Polls GitHub releases hourly, notifies when a new Omegon release is available |
232
+ | `web-ui` | Localhost-only read-only HTTP dashboard and JSON control-plane endpoints (`/web-ui [start|stop|status|open]`) |
233
+
234
+ ## Skills
235
+
236
+ Skills provide specialized instructions the agent loads on-demand when a task matches.
237
+
238
+ | Skill | Description |
239
+ |-------|-------------|
240
+ | `openspec` | OpenSpec lifecycle — writing specs, deriving API contracts, generating tasks, verifying implementations |
241
+ | `cleave` | Task decomposition, code assessment, OpenSpec lifecycle integration |
242
+ | `git` | Conventional commits, semantic versioning, branch naming, changelogs |
243
+ | `oci` | Container and artifact best practices — Containerfile authoring, multi-arch builds, registry auth |
244
+ | `python` | Project setup (src/ layout, pyproject.toml), pytest, ruff, mypy, packaging, venv |
245
+ | `rust` | Cargo, clippy, rustfmt, Zellij WASM plugin development |
246
+ | `typescript` | Strict typing, async patterns, error handling, node:test conventions for Omegon |
247
+ | `pi-extensions` | pi extension API — `registerCommand`, `registerTool`, event handlers, TUI context, common pitfalls |
248
+ | `pi-tui` | TUI component patterns — `Component` interface, overlays, keyboard handling, theming, footer/widget APIs |
249
+ | `security` | Input escaping, injection prevention, path traversal, process safety, secrets management |
250
+ | `style` | Alpharius color system, typography, spacing — shared across TUI, D2 diagrams, and generated images |
251
+ | `vault` | Obsidian-compatible markdown conventions — wikilinks, frontmatter, vault-friendly file organization |
252
+
253
+ ## Prompt Templates
254
+
255
+ Pre-built prompts for common workflows:
256
+
257
+ | Template | Description |
258
+ |----------|-------------|
259
+ | `new-repo` | Scaffold a new repository with conventions |
260
+ | `init` | First-session environment check — orient to a new project directory |
261
+ | `status` | Session orientation — load project state and show what's active |
262
+ | `oci-login` | OCI registry authentication |
263
+
264
+ ## Requirements
265
+
266
+ **Required:**
267
+ - `@cwilson613/pi-coding-agent` ≥ 0.57 — patched fork of [badlogic/pi-mono](https://github.com/badlogic/pi-mono). Install via `npm install -g @cwilson613/pi-coding-agent`. Fork source: [cwilson613/pi-mono](https://github.com/cwilson613/pi-mono)
268
+
269
+ **Optional (installed by `/bootstrap`):**
270
+ - [Ollama](https://ollama.ai) — local inference, offline mode, semantic memory search
271
+ - [d2](https://d2lang.com) — diagram rendering
272
+ - [mflux](https://github.com/filipstrand/mflux) — FLUX.1 image generation on Apple Silicon
273
+ - API keys for web search (Brave, Tavily, or Serper)
274
+
275
+ Run `/bootstrap` after install to check dependencies and configure preferences.
276
+
277
+ ## Why a Patched Fork?
278
+
279
+ Upstream [`badlogic/pi-mono`](https://github.com/badlogic/pi-mono) is the canonical pi coding agent. Omegon depends on a fork rather than the upstream package for two reasons:
280
+
281
+ 1. **OAuth login reliability** — upstream had no fetch timeout on OAuth token exchange calls. A slow or unreachable endpoint would hang the login UI indefinitely with no recovery path. Fixed in [`packages/ai/src/utils/oauth/`](https://github.com/cwilson613/pi-mono/tree/main/packages/ai/src/utils/oauth).
282
+
283
+ 2. **Bracketed-paste stuck state** — a missing end-marker (e.g. from a large paste that split across chunks) would leave `isInPaste = true` permanently, silently swallowing all subsequent keystrokes including Enter. Fixed with a 500ms watchdog timer and Escape-to-clear in [`packages/tui/src/components/input.ts`](https://github.com/cwilson613/pi-mono/blob/main/packages/tui/src/components/input.ts).
284
+
285
+ Both fixes are submitted as PRs to upstream ([#2060](https://github.com/badlogic/pi-mono/pull/2060), [#2061](https://github.com/badlogic/pi-mono/pull/2061)). Once merged, the fork becomes a pass-through and the dependency can revert to `@mariozechner/pi-coding-agent`.
286
+
287
+ ## License
288
+
289
+ ISC
package/bin/pi.mjs ADDED
@@ -0,0 +1,30 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Omegon pi entry point.
4
+ *
5
+ * Sets PI_CODING_AGENT_DIR to the omegon package root so pi loads all agent
6
+ * configuration (extensions, themes, skills, AGENTS.md) from omegon rather
7
+ * than from ~/.pi/agent/.
8
+ *
9
+ * Resolution order for pi core:
10
+ * 1. vendor/pi-mono (dev mode — git submodule present)
11
+ * 2. node_modules/@cwilson613/pi-coding-agent (installed via npm)
12
+ */
13
+ import { dirname, join } from "node:path";
14
+ import { existsSync } from "node:fs";
15
+ import { fileURLToPath } from "node:url";
16
+
17
+ const __filename = fileURLToPath(import.meta.url);
18
+ const omegonRoot = dirname(dirname(__filename));
19
+
20
+ // Only set if not already overridden
21
+ if (!process.env.PI_CODING_AGENT_DIR) {
22
+ process.env.PI_CODING_AGENT_DIR = omegonRoot;
23
+ }
24
+
25
+ // Resolve pi core: prefer vendor/ (dev), fall back to node_modules/ (installed)
26
+ const vendorCli = join(omegonRoot, "vendor/pi-mono/packages/coding-agent/dist/cli.js");
27
+ const npmCli = join(omegonRoot, "node_modules/@cwilson613/pi-coding-agent/dist/cli.js");
28
+
29
+ const cli = existsSync(vendorCli) ? vendorCli : npmCli;
30
+ await import(cli);