@pi-unipi/unipi 0.1.16 → 0.1.17

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 (74) hide show
  1. package/README.md +126 -249
  2. package/package.json +4 -2
  3. package/packages/ask-user/README.md +34 -43
  4. package/packages/ask-user/ask-ui.ts +657 -0
  5. package/packages/ask-user/commands.ts +50 -0
  6. package/packages/ask-user/config.ts +139 -0
  7. package/packages/ask-user/settings-tui.ts +186 -0
  8. package/packages/ask-user/tools.ts +347 -0
  9. package/packages/ask-user/types.ts +68 -0
  10. package/packages/btw/README.md +32 -61
  11. package/packages/compactor/README.md +13 -25
  12. package/packages/core/README.md +20 -11
  13. package/packages/core/constants.ts +337 -0
  14. package/packages/core/events.ts +411 -0
  15. package/packages/core/model-cache.ts +70 -0
  16. package/packages/core/sandbox.ts +94 -0
  17. package/packages/core/utils.ts +196 -0
  18. package/packages/footer/README.md +73 -158
  19. package/packages/footer/types.ts +7 -0
  20. package/packages/info-screen/README.md +17 -31
  21. package/packages/info-screen/config.ts +171 -0
  22. package/packages/info-screen/core-groups.ts +642 -0
  23. package/packages/info-screen/registry.ts +272 -0
  24. package/packages/info-screen/tui/info-overlay.ts +495 -0
  25. package/packages/info-screen/types.ts +76 -0
  26. package/packages/info-screen/usage-parser.ts +308 -0
  27. package/packages/input-shortcuts/README.md +29 -66
  28. package/packages/kanboard/README.md +36 -81
  29. package/packages/kanboard/commands.ts +84 -0
  30. package/packages/kanboard/tui/kanboard-overlay.ts +298 -0
  31. package/packages/kanboard/types.ts +67 -0
  32. package/packages/mcp/README.md +40 -53
  33. package/packages/memory/README.md +39 -40
  34. package/packages/memory/commands.ts +204 -0
  35. package/packages/memory/embedding.ts +243 -0
  36. package/packages/memory/search.ts +134 -0
  37. package/packages/memory/settings.ts +135 -0
  38. package/packages/memory/storage.ts +941 -0
  39. package/packages/memory/tools.ts +423 -0
  40. package/packages/memory/tui/settings-tui.ts +281 -0
  41. package/packages/milestone/README.md +43 -68
  42. package/packages/milestone/coexist.ts +114 -0
  43. package/packages/milestone/commands.ts +97 -0
  44. package/packages/milestone/hooks.ts +208 -0
  45. package/packages/milestone/milestone.ts +238 -0
  46. package/packages/milestone/types.ts +61 -0
  47. package/packages/notify/README.md +51 -74
  48. package/packages/notify/commands.ts +342 -0
  49. package/packages/notify/events.ts +346 -0
  50. package/packages/notify/ntfy-config.ts +178 -0
  51. package/packages/notify/platforms/gotify.ts +36 -0
  52. package/packages/notify/platforms/native.ts +47 -0
  53. package/packages/notify/platforms/node-notifier.d.ts +20 -0
  54. package/packages/notify/platforms/ntfy.ts +48 -0
  55. package/packages/notify/platforms/telegram.ts +77 -0
  56. package/packages/notify/settings.ts +137 -0
  57. package/packages/notify/summarize.ts +149 -0
  58. package/packages/notify/tools.ts +91 -0
  59. package/packages/notify/tui/gotify-setup.ts +528 -0
  60. package/packages/notify/tui/ntfy-setup.ts +652 -0
  61. package/packages/notify/tui/recap-model-selector.ts +301 -0
  62. package/packages/notify/tui/settings-overlay.ts +326 -0
  63. package/packages/notify/tui/telegram-setup.ts +301 -0
  64. package/packages/notify/types.ts +114 -0
  65. package/packages/ralph/README.md +28 -34
  66. package/packages/ralph/ralph-loop.ts +431 -0
  67. package/packages/ralph/tools.ts +156 -0
  68. package/packages/subagents/README.md +36 -44
  69. package/packages/updater/README.md +41 -35
  70. package/packages/updater/types.ts +69 -0
  71. package/packages/utility/README.md +70 -144
  72. package/packages/web-api/README.md +67 -161
  73. package/packages/workflow/README.md +39 -55
  74. package/packages/workflow/commands.ts +472 -0
package/README.md CHANGED
@@ -1,291 +1,168 @@
1
1
  # Unipi
2
2
 
3
- All-in-one extension suite for the [Pi coding agent](https://github.com/badlogic/pi-mono).
3
+ 18 packages that turn Pi into a full development workstation. Structured workflows, persistent memory, parallel agents, web research, notifications, context management, and a live status bar — all wired together through a shared event system.
4
4
 
5
- ## Install
6
-
7
- **All-in-one:**
5
+ One command installs everything:
8
6
  ```bash
9
7
  pi install npm:@pi-unipi/unipi
10
8
  ```
11
9
 
12
- **Individual packages:**
13
- ```bash
14
- pi install npm:@pi-unipi/core
15
- pi install npm:@pi-unipi/workflow
16
- pi install npm:@pi-unipi/ralph
17
- pi install npm:@pi-unipi/memory
18
- pi install npm:@pi-unipi/info-screen
19
- pi install npm:@pi-unipi/subagents
20
- pi install npm:@pi-unipi/btw
21
- pi install npm:@pi-unipi/web-api
22
- pi install npm:@pi-unipi/compactor
23
- pi install npm:@pi-unipi/notify
24
- pi install npm:@pi-unipi/utility
25
- pi install npm:@pi-unipi/mcp
26
- pi install npm:@pi-unipi/ask-user
27
- pi install npm:@pi-unipi/milestone
28
- pi install npm:@pi-unipi/kanboard
29
- pi install npm:@pi-unipi/footer
30
- pi install npm:@pi-unipi/updater
31
- ```
32
-
33
- ## Packages
34
-
35
- | Package | Description |
36
- |---------|-------------|
37
- | `@pi-unipi/core` | Shared utilities, event types, constants |
38
- | `@pi-unipi/workflow` | 20 structured development workflow commands |
39
- | `@pi-unipi/ralph` | Long-running iterative development loops |
40
- | `@pi-unipi/memory` | Persistent cross-session memory with vector search |
41
- | `@pi-unipi/info-screen` | Dashboard and module registry overlay |
42
- | `@pi-unipi/subagents` | Parallel sub-agent execution with file locking |
43
- | `@pi-unipi/btw` | Parallel side conversations with `/btw` |
44
- | `@pi-unipi/web-api` | Web search, read, and summarize with provider selection |
45
- | `@pi-unipi/compactor` | Session compaction, context management, batch execution |
46
- | `@pi-unipi/notify` | Cross-platform notifications (native, Gotify, Telegram, ntfy) |
47
- | `@pi-unipi/utility` | Environment info, diagnostics, settings inspector, cleanup |
48
- | `@pi-unipi/mcp` | MCP server discovery, connection, and tool integration |
49
- | `@pi-unipi/ask-user` | Structured user input with options and freeform text |
50
- | `@pi-unipi/milestone` | Milestone tracking and project progress management |
51
- | `@pi-unipi/kanboard` | Kanboard visualization server with TUI overlay |
52
- | `@pi-unipi/footer` | Persistent status bar with live stats from all packages |
53
- | `@pi-unipi/updater` | Auto-updater, changelog browser, and readme browser |
54
-
55
- ## Commands
56
-
57
- ### Workflow (`/unipi:*`)
58
-
59
- | Command | Description |
60
- |---------|-------------|
61
- | `/unipi:brainstorm` | Collaborative discovery |
62
- | `/unipi:plan` | Strategic planning |
63
- | `/unipi:work` | Execute plan in worktree |
64
- | `/unipi:review-work` | Review what was built |
65
- | `/unipi:consolidate` | Merge findings, update docs |
66
- | `/unipi:auto` | Full pipeline — brainstorm → plan → work → review → merge |
67
- | `/unipi:worktree-create` | Create git worktree |
68
- | `/unipi:worktree-list` | List all worktrees |
69
- | `/unipi:worktree-merge` | Merge worktree back |
70
- | `/unipi:consultant` | Expert panel review |
71
- | `/unipi:quick-work` | Fast single-task execution |
72
- | `/unipi:gather-context` | Research codebase |
73
- | `/unipi:document` | Generate documentation |
74
- | `/unipi:scan-issues` | Find bugs, anti-patterns |
75
- | `/unipi:debug` | Active bug investigation — reproduce, diagnose, root-cause |
76
- | `/unipi:fix` | Fix bugs using debug reports |
77
- | `/unipi:quick-fix` | Fast one-shot fix for clear bugs |
78
- | `/unipi:research` | Deep codebase investigation and documentation review |
79
- | `/unipi:chore-create` | Create reusable chore (deploy, publish, etc.) |
80
- | `/unipi:chore-execute` | Run a saved chore |
81
-
82
- ### Ralph (`/unipi:ralph`)
83
-
84
- | Command | Description |
85
- |---------|-------------|
86
- | `/unipi:ralph start <name>` | Start a loop |
87
- | `/unipi:ralph stop` | Pause current loop |
88
- | `/unipi:ralph resume <name>` | Resume a paused loop |
89
- | `/unipi:ralph status` | Show all loops |
90
- | `/unipi:ralph cancel <name>` | Delete loop state |
91
- | `/unipi:ralph archive <name>` | Archive completed loop |
92
- | `/unipi:ralph clean` | Clean completed loops |
93
- | `/unipi:ralph nuke` | Delete all ralph data |
94
-
95
- ### Memory (`/unipi:*-memory-*`)
96
-
97
- | Command | Description |
98
- |---------|-------------|
99
- | `/unipi:memory-process <text>` | Store extracted memories |
100
- | `/unipi:memory-search <term>` | Search project memories |
101
- | `/unipi:memory-consolidate` | Consolidate session into memory |
102
- | `/unipi:memory-forget <title>` | Delete a memory |
103
- | `/unipi:global-memory-search <term>` | Search global memories |
104
- | `/unipi:global-memory-list` | List all global memories |
105
-
106
- ### BTW (`/btw*`)
107
-
108
- | Command | Description |
109
- |---------|-------------|
110
- | `/btw [--save] <question>` | Side conversation (contextual) |
111
- | `/btw:tangent [--save] <q>` | Contextless tangent thread |
112
- | `/btw:new [question]` | Fresh thread with main-session context |
113
- | `/btw:clear` | Dismiss and clear thread |
114
- | `/btw:inject [instructions]` | Send full thread to main agent |
115
- | `/btw:summarize [instr]` | Summarize and inject into main agent |
116
-
117
- ### Info Screen (`/unipi:info*`)
118
-
119
- | Command | Description |
120
- |---------|-------------|
121
- | `/unipi:info` | Show info dashboard |
122
- | `/unipi:info-settings` | Configure info display |
123
-
124
- ### Web API (`/unipi:web-*`)
125
-
126
- | Command | Description |
127
- |---------|-------------|
128
- | `/unipi:web-settings` | Configure providers and API keys |
129
- | `/unipi:web-cache-clear` | Clear all cached web content |
130
-
131
- ### Compactor (`/unipi:compact*`)
132
-
133
- | Command | Description |
134
- |---------|-------------|
135
- | `/unipi:compact` | Compact session into brief |
136
- | `/unipi:compact-recall` | Recall from compacted sessions |
137
- | `/unipi:compact-stats` | Show compaction statistics |
138
- | `/unipi:compact-doctor` | Diagnose compactor issues |
139
- | `/unipi:compact-settings` | Configure compactor |
140
- | `/unipi:compact-preset` | Apply compaction presets |
141
- | `/unipi:compact-index` | Index context for search |
142
- | `/unipi:compact-search` | Search indexed context |
143
- | `/unipi:compact-purge` | Purge old compacted data |
144
-
145
- ### Notify (`/unipi:notify-*`)
146
-
147
- | Command | Description |
148
- |---------|-------------|
149
- | `/unipi:notify-settings` | Configure notification platforms |
150
- | `/unipi:notify-set-gotify` | Set Gotify server config |
151
- | `/unipi:notify-set-tg` | Set Telegram bot config |
152
- | `/unipi:notify-set-ntfy` | Set ntfy topic and server |
153
- | `/unipi:notify-recap-model` | Set model for notification recaps |
154
- | `/unipi:notify-test` | Test notification delivery |
155
-
156
- ### Utility (`/unipi:*`)
157
-
158
- | Command | Description |
159
- |---------|-------------|
160
- | `/unipi:env` | Show environment info |
161
- | `/unipi:doctor` | Run diagnostics |
162
- | `/unipi:status` | Show module status |
163
- | `/unipi:cleanup` | Clean stale temp files |
164
- | `/unipi:reload` | Reload extensions |
165
- | `/unipi:name-badge` | Toggle session name badge overlay |
166
- | `/unipi:badge-gen` | Generate session name via background agent |
167
- | `/unipi:badge-toggle` | Configure badge settings |
168
-
169
- ### MCP (`/unipi:mcp-*`)
170
-
171
- | Command | Description |
172
- |---------|-------------|
173
- | `/unipi:mcp-add` | Add MCP server |
174
- | `/unipi:mcp-settings` | Configure MCP servers |
175
- | `/unipi:mcp-sync` | Sync MCP tools |
176
- | `/unipi:mcp-status` | Show MCP connection status |
177
- | `/unipi:mcp-reload` | Reload MCP connections |
178
-
179
- ### Tools
180
-
181
- | Tool | Package | Description |
182
- |------|---------|-------------|
183
- | `ralph_start` | ralph | Start a ralph loop |
184
- | `ralph_done` | ralph | Signal iteration complete |
185
- | `spawn_helper` | subagents | Spawn parallel sub-agent |
186
- | `get_helper_result` | subagents | Retrieve background agent result |
187
- | `memory_store` | memory | Store/update memory |
188
- | `memory_search` | memory | Search project memories |
189
- | `memory_delete` | memory | Delete memory by ID |
190
- | `memory_list` | memory | List project memories |
191
- | `global_memory_search` | memory | Search global memories |
192
- | `global_memory_list` | memory | List global memories |
193
- | `web_search` | web-api | Search the web via provider |
194
- | `web_read` | web-api | Extract content from URL |
195
- | `web_llm_summarize` | web-api | Summarize web content via LLM |
196
- | `notify_user` | notify | Send cross-platform notifications |
197
- | `ask_user` | ask-user | Structured user input with options |
198
- | `compact` | compactor | Compact session context |
199
- | `vcc_recall` | compactor | Recall from compacted sessions |
200
- | `ctx_execute` | compactor | Execute with context management |
201
- | `ctx_batch_execute` | compactor | Batch execute with rollback |
202
- | `ctx_index` | compactor | Index context for search |
203
- | `ctx_search` | compactor | Search indexed context |
204
- | `ctx_fetch_and_index` | compactor | Fetch and index web content |
205
- | `ctx_stats` | compactor | Show compaction statistics |
206
- | `ctx_doctor` | compactor | Diagnose compactor issues |
207
- | `set_session_name` | utility | Set session name for badge display |
208
- | `ctx_batch` | utility | Atomic batch execution with rollback |
209
- | `ctx_env` | utility | Show environment information |
210
-
211
- ### Milestone (`/unipi:milestone-*`)
10
+ ## What You Get
212
11
 
213
- | Command | Description |
214
- |---------|-------------|
215
- | `/unipi:milestone-onboard` | Create MILESTONES.md from existing workflow docs |
216
- | `/unipi:milestone-update` | Sync MILESTONES.md with completed work |
12
+ **Workflow** 20 commands that take ideas to shipped code. Brainstorm, plan, execute in worktrees, review, consolidate. The agent follows skill files step by step.
217
13
 
218
- ### Kanboard (`/unipi:kanboard*`)
14
+ **Ralph** Long-running loops that persist across sessions. Start a task, iterate through checklist items, resume after crashes. Progress tracked, state saved.
219
15
 
220
- | Command | Description |
221
- |---------|-------------|
222
- | `/unipi:kanboard` | Toggle kanboard visualization server |
223
- | `/unipi:kanboard-doctor` | Diagnose and fix kanboard parser issues |
16
+ **Memory** SQLite + vector search stores facts, preferences, and decisions. Project-scoped and global. The agent remembers what you told it last week.
224
17
 
225
- ### Footer (`/unipi:footer*`)
18
+ **Compactor** Zero-LLM context engine. 6-stage pipeline hits 95%+ token reduction at zero API cost. Session continuity, sandbox execution, FTS5 search.
226
19
 
227
- | Command | Description |
228
- |---------|-------------|
229
- | `/unipi:footer` | Toggle footer or switch preset |
230
- | `/unipi:footer-settings` | Open footer settings — toggle groups and segments |
20
+ **Subagents** Parallel execution with file locking. Spawn background agents to research, fix, or build while the main agent keeps going.
231
21
 
232
- ### Updater (`/unipi:updater*`)
22
+ **Web API** — Web search, page reading, content summarization. Smart-fetch engine with browser-grade TLS fingerprinting — free, no API key. Paid providers as fallbacks.
233
23
 
234
- | Command | Description |
235
- |---------|-------------|
236
- | `/unipi:readme [package]` | Browse package README files in TUI overlay |
237
- | `/unipi:changelog` | Browse CHANGELOG.md with version list and detail view |
238
- | `/unipi:updater-settings` | Configure check interval and auto-update mode |
24
+ **MCP** Browse 7,800+ MCP servers, add them interactively. Tools from servers register automatically as Pi tools.
239
25
 
240
- ### Name Badge
26
+ **Notify** Push notifications to native OS, Gotify, Telegram, or ntfy. Per-event platform routing. Configure once, get alerts everywhere.
241
27
 
242
- ## How It Works
28
+ **Footer** Persistent status bar showing live stats from every package. Responsive layout, presets, per-segment toggling.
243
29
 
244
- **Core** provides shared infrastructure event types, constants, utilities so modules discover each other without tight coupling.
30
+ **BTW** — Side conversations that run in parallel. Ask questions without interrupting the main agent.
245
31
 
246
- **Workflow** provides 20 commands guiding work from idea to completion: brainstorm → plan → work → review → consolidate, plus quick-fix, debug, research, chore, and more.
32
+ **Ask User** Structured input for decision gates. Single-select, multi-select, freeform. The agent asks instead of guessing.
247
33
 
248
- **Ralph** enables long-running iterative tasks. Start a loop, the agent works through iterations, reflects periodically, and completes when done.
34
+ **Milestone** Track project goals across workflow cycles. MILESTONES.md stays in sync with specs, plans, and completed work.
249
35
 
250
- **Memory** provides persistent cross-session memory with SQLite + vector search. Project-scoped and global memories with hybrid search.
36
+ **Kanboard** Web UI and TUI overlay for kanban boards. Parses all workflow documents into cards with progress indicators.
251
37
 
252
- **Info Screen** is a dashboard overlay showing module status, registered tools, and custom groups from all modules.
38
+ **Info Screen** Dashboard overlay showing module status, tools, and custom data groups.
253
39
 
254
- **BTW** adds a parallel side-conversation channel. Ask questions while the main agent keeps working, then inject or summarize the thread back.
40
+ **Utility** Environment info, diagnostics, cleanup, name badge, and Shiki-powered diff rendering.
255
41
 
256
- **Subagents** enables parallel execution with file locking, activity tracking, and custom agent types.
42
+ **Updater** Checks npm for new versions on session start. Changelog browser and readme browser in TUI overlays.
257
43
 
258
- **Web API** provides web search, page reading, and LLM summarization through a ranked provider system. DuckDuckGo and Jina work out of the box; paid providers (SerpAPI, Tavily, Firecrawl, Perplexity) are configured via `/unipi:web-settings`.
44
+ **Input Shortcuts** Keyboard shortcuts via vim-style chord overlay. Stash/restore, undo/redo, clipboard, thinking toggle.
259
45
 
260
- **Compactor** manages session context with compaction, indexing, search, and batch execution. Keep context lean without losing important information.
46
+ ## Architecture
261
47
 
262
- **Notify** sends notifications across platforms native OS, Gotify, and Telegram. Configure once, get alerts everywhere.
48
+ Packages discover each other through events, not direct imports. Core defines the event types and constants. Every package emits `MODULE_READY` on load and subscribes to events it cares about.
263
49
 
264
- **Utility** provides environment info, diagnostics, settings inspection, and cleanup tools for maintaining your development environment.
50
+ ```
51
+ ┌─────────────────────────────────────────────────────────┐
52
+ │ Core │
53
+ │ Events, Constants, Utilities │
54
+ └───────────────────────┬─────────────────────────────────┘
55
+
56
+ ┌───────────────────┼───────────────────┐
57
+ │ │ │
58
+ ▼ ▼ ▼
59
+ ┌─────────┐ ┌──────────┐ ┌──────────┐
60
+ │ Workflow │ │ Compactor│ │ Memory │
61
+ │ Skills │ │ Engine │ │ Store │
62
+ └────┬─────┘ └────┬─────┘ └────┬─────┘
63
+ │ │ │
64
+ └──────────────────┼──────────────────┘
65
+
66
+ ┌──────────┐
67
+ │ Footer │ ← Subscribes to all events
68
+ └──────────┘
69
+ ```
265
70
 
266
- **MCP** integrates Model Context Protocol servers discover, connect, and use external tool servers seamlessly.
71
+ Coexists triggers enhance behavior when packages are installed together. Workflow skills detect subagents and inject parallel strategies. All skills get MCP tools when MCP is installed. Web-api adds web research to investigation skills. Each package works standalone.
72
+
73
+ ## Commands (Brief)
74
+
75
+ | Category | Prefix | Examples |
76
+ |----------|--------|----------|
77
+ | Workflow | `/unipi:` | brainstorm, plan, work, review-work, consolidate, quick-work, debug, fix |
78
+ | Ralph | `/unipi:ralph` | start, stop, resume, status |
79
+ | Memory | `/unipi:memory-` | process, search, consolidate, forget |
80
+ | Compactor | `/unipi:compact` | compact, stats, settings, preset |
81
+ | Notify | `/unipi:notify-` | settings, test, set-tg, set-ntfy |
82
+ | MCP | `/unipi:mcp-` | add, settings, sync, status |
83
+ | Web | `/unipi:web-` | settings, cache-clear |
84
+ | BTW | `/btw` | question, new, tangent, inject, summarize |
85
+ | Utility | `/unipi:` | env, doctor, status, cleanup, name-badge |
86
+ | Milestone | `/unipi:milestone-` | onboard, update |
87
+ | Kanboard | `/unipi:kanboard` | toggle, doctor |
88
+ | Footer | `/unipi:footer` | toggle, settings |
89
+ | Updater | `/unipi:` | readme, changelog, updater-settings |
90
+ | Info | `/unipi:info` | dashboard, settings |
91
+
92
+ ## Agent Tools (Brief)
93
+
94
+ | Tool | Package | What It Does |
95
+ |------|---------|--------------|
96
+ | `ralph_start` / `ralph_done` | ralph | Loop control |
97
+ | `spawn_helper` / `get_helper_result` | subagents | Parallel agents |
98
+ | `memory_store` / `memory_search` / `memory_delete` | memory | Memory CRUD |
99
+ | `web_search` / `web_read` / `web_llm_summarize` | web-api | Web research |
100
+ | `notify_user` | notify | Push notifications |
101
+ | `ask_user` | ask-user | User input |
102
+ | `compact` / `session_recall` / `sandbox` | compactor | Context management |
103
+ | `ctx_batch` / `ctx_env` | utility | Batch execution, env info |
267
104
 
268
- **Ask User** provides structured user input with multiple-choice, multi-select, and freeform text options.
105
+ ## Development
269
106
 
270
- **Milestone** tracks project progress with MILESTONES.md — onboards existing work and syncs with completed tasks.
107
+ ```bash
108
+ git clone https://github.com/Neuron-Mr-White/unipi.git
109
+ cd unipi
110
+ npm install
111
+ npm run typecheck
112
+ ```
271
113
 
272
- **Kanboard** provides a visualization server with htmx + Alpine.js UI for kanban boards, workflow timelines, and milestone progress. Includes a TUI overlay for quick access.
114
+ ### Project Structure
273
115
 
274
- **Footer** renders a persistent status bar at the bottom of the terminal, showing live stats from all Unipi packages — compactor tokens, memory count, MCP status, Ralph loops, workflow state, kanboard tasks, and notifications. Fully configurable with presets and per-segment toggles.
116
+ ```
117
+ unipi/
118
+ ├── packages/
119
+ │ ├── core/ # Shared constants, events, utilities
120
+ │ ├── workflow/ # 20 skill-based commands
121
+ │ ├── ralph/ # Iterative loops
122
+ │ ├── memory/ # SQLite + vector search
123
+ │ ├── compactor/ # Context engine
124
+ │ ├── subagents/ # Parallel execution
125
+ │ ├── web-api/ # Web research
126
+ │ ├── mcp/ # MCP server integration
127
+ │ ├── notify/ # Push notifications
128
+ │ ├── footer/ # Status bar
129
+ │ ├── btw/ # Side conversations
130
+ │ ├── ask-user/ # Structured input
131
+ │ ├── milestone/ # Goal tracking
132
+ │ ├── kanboard/ # Kanban visualization
133
+ │ ├── info-screen/ # Dashboard overlay
134
+ │ ├── utility/ # Diagnostics, diff rendering
135
+ │ ├── updater/ # Auto-update, browsers
136
+ │ ├── input-shortcuts/ # Keyboard shortcuts
137
+ │ └── unipi/ # Umbrella package
138
+ ├── .unipi/ # Runtime data (specs, plans, worktrees)
139
+ └── CHANGELOG.md
140
+ ```
275
141
 
276
- ## Module Discovery
142
+ ### Adding a Package
277
143
 
278
- Modules announce presence via `pi.events`. When `@pi-unipi/workflow` detects `@pi-unipi/ralph`, it enables loop integration. Each module works standalone.
144
+ 1. Create `packages/your-package/` with `package.json` and `index.ts`
145
+ 2. Depend on `@pi-unipi/core` for constants and events
146
+ 3. Emit `MODULE_READY` on load
147
+ 4. Add to umbrella package dependencies and imports
148
+ 5. Run `npm run typecheck`
279
149
 
280
- ## Development
150
+ ### Running Tests
281
151
 
282
152
  ```bash
283
- git clone https://github.com/Neuron-Mr-White/unipi.git
284
- cd unipi
285
- npm install
286
- npm run typecheck
153
+ npm test
287
154
  ```
288
155
 
156
+ ## Contributing
157
+
158
+ 1. Fork the repo
159
+ 2. Create a feature branch
160
+ 3. Make your changes
161
+ 4. Run `npm run typecheck` and `npm test`
162
+ 5. Submit a pull request
163
+
164
+ Keep packages focused. One package, one responsibility. Use events for cross-package communication — no direct imports between packages.
165
+
289
166
  ## License
290
167
 
291
168
  MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-unipi/unipi",
3
- "version": "0.1.16",
3
+ "version": "0.1.17",
4
4
  "description": "All-in-one extension suite for Pi coding agent",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -28,9 +28,11 @@
28
28
  "publish:all": "npm publish --workspaces --access public"
29
29
  },
30
30
  "files": [
31
- "packages/*/index.ts",
31
+ "packages/*/*.ts",
32
32
  "packages/*/src/**/*.ts",
33
33
  "packages/*/extensions/**/*.ts",
34
+ "packages/*/platforms/*",
35
+ "packages/*/tui/*",
34
36
  "packages/*/skills/**/*",
35
37
  "packages/*/README.md"
36
38
  ],
@@ -1,30 +1,24 @@
1
1
  # @pi-unipi/ask-user
2
2
 
3
- Structured user input tool for the Pi coding agent — part of the Unipi suite.
3
+ Structured user input for decision gates. When the agent needs you to pick between options which database, which approach, which files to change — it calls `ask_user` instead of guessing.
4
4
 
5
- ## Features
5
+ Three input modes: single-select (pick one), multi-select (toggle several), freeform (type your own). The agent presents the question, you answer, it continues.
6
6
 
7
- ### `ask_user` Tool
7
+ ## Commands
8
8
 
9
- Ask the user a question with structured options. Supports three modes:
9
+ Ask-user has no user commands. It's an agent tool package the agent calls it when it needs input.
10
10
 
11
- - **Single-select** — Pick one option from a list
12
- - **Multi-select** — Toggle multiple options, then submit
13
- - **Freeform** — Type a custom answer
11
+ ## Special Triggers
14
12
 
15
- ### Usage
13
+ All workflow skills detect ask-user and use it for decision gates. Instead of the agent deciding on its own, it presents options and waits for your input. This happens naturally during brainstorm, plan, work, and other skills when the agent faces ambiguity.
16
14
 
17
- The agent calls the tool when it needs user input:
15
+ The bundled skill guides the agent to use `ask_user` for high-stakes decisions — architecture choices, database selection, naming decisions, anything with lasting impact.
18
16
 
19
- ```typescript
20
- ask_user({
21
- question: "Which database should we use?",
22
- options: [
23
- { label: "PostgreSQL", description: "Reliable, feature-rich" },
24
- { label: "SQLite", description: "Simple, serverless" },
25
- ],
26
- })
27
- ```
17
+ ## Agent Tool
18
+
19
+ | Tool | Description |
20
+ |------|-------------|
21
+ | `ask_user` | Structured user input with options |
28
22
 
29
23
  ### Parameters
30
24
 
@@ -37,12 +31,24 @@ ask_user({
37
31
  | `allowFreeform` | boolean? | true | Allow freeform text input |
38
32
  | `timeout` | number? | — | Auto-dismiss after N ms |
39
33
 
34
+ ### Example
35
+
36
+ ```typescript
37
+ ask_user({
38
+ question: "Which database should we use?",
39
+ options: [
40
+ { label: "PostgreSQL", description: "Reliable, feature-rich" },
41
+ { label: "SQLite", description: "Simple, serverless" },
42
+ ],
43
+ })
44
+ ```
45
+
40
46
  ### Keyboard Controls
41
47
 
42
48
  | Mode | Keys |
43
49
  |------|------|
44
- | Single-select | ↑↓ navigate, Enter select, Esc cancel |
45
- | Multi-select | ↑↓ navigate, Space toggle, Enter submit, Esc cancel |
50
+ | Single-select | Up/Down navigate, Enter select, Esc cancel |
51
+ | Multi-select | Up/Down navigate, Space toggle, Enter submit, Esc cancel |
46
52
  | Freeform | Type text, Enter submit, Esc back |
47
53
 
48
54
  ### TUI Display
@@ -57,7 +63,7 @@ ask_user({
57
63
  Option C
58
64
  Type something...
59
65
 
60
- ↑↓ navigate Enter select Esc cancel
66
+ Up/Down navigate, Enter select, Esc cancel
61
67
  ─────────────────────────────
62
68
  ```
63
69
 
@@ -66,34 +72,19 @@ ask_user({
66
72
  ─────────────────────────────
67
73
  Which features to enable?
68
74
  ─────────────────────────────
69
- > [] Logging
75
+ > [x] Logging
70
76
  [ ] Metrics
71
- [] Tracing
77
+ [x] Tracing
72
78
  [ ] Type something...
73
79
 
74
- ↑↓ navigate Space toggle Enter submit Esc cancel
80
+ Up/Down navigate, Space toggle, Enter submit, Esc cancel
75
81
  ─────────────────────────────
76
82
  ```
77
83
 
78
- ## Installation
79
-
80
- ```bash
81
- pi install npm:@pi-unipi/ask-user
82
- ```
83
-
84
- Or install the full Unipi suite:
85
-
86
- ```bash
87
- pi install npm:@pi-unipi/unipi
88
- ```
89
-
90
- ## Bundled Skill
84
+ ## Configurables
91
85
 
92
- The package includes a skill that guides the agent to use `ask_user` for high-stakes decisions. The skill is automatically discovered when the extension loads.
86
+ Ask-user has no configuration. Input mode is determined by the `allowMultiple` and `allowFreeform` parameters the agent passes.
93
87
 
94
- ## Dependencies
88
+ ## License
95
89
 
96
- - `@pi-unipi/core` — Shared constants and utilities
97
- - `@mariozechner/pi-coding-agent` — Pi extension API
98
- - `@mariozechner/pi-tui` — TUI components
99
- - `@sinclair/typebox` — Schema validation
90
+ MIT