pi-mono-all 1.0.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 (161) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/LICENCE.md +7 -0
  3. package/node_modules/pi-common/package.json +22 -0
  4. package/node_modules/pi-common/src/auth-config.ts +290 -0
  5. package/node_modules/pi-common/src/auth.ts +63 -0
  6. package/node_modules/pi-common/src/cache.ts +60 -0
  7. package/node_modules/pi-common/src/errors.ts +47 -0
  8. package/node_modules/pi-common/src/http-client.ts +118 -0
  9. package/node_modules/pi-common/src/index.ts +7 -0
  10. package/node_modules/pi-common/src/rate-limiter.ts +32 -0
  11. package/node_modules/pi-common/src/tool-result.ts +27 -0
  12. package/node_modules/pi-mono-ask-user-question/CHANGELOG.md +185 -0
  13. package/node_modules/pi-mono-ask-user-question/README.md +226 -0
  14. package/node_modules/pi-mono-ask-user-question/index.ts +923 -0
  15. package/node_modules/pi-mono-ask-user-question/package.json +29 -0
  16. package/node_modules/pi-mono-auto-fix/CHANGELOG.md +59 -0
  17. package/node_modules/pi-mono-auto-fix/README.md +77 -0
  18. package/node_modules/pi-mono-auto-fix/index.ts +488 -0
  19. package/node_modules/pi-mono-auto-fix/package.json +23 -0
  20. package/node_modules/pi-mono-btw/CHANGELOG.md +180 -0
  21. package/node_modules/pi-mono-btw/README.md +24 -0
  22. package/node_modules/pi-mono-btw/index.ts +499 -0
  23. package/node_modules/pi-mono-btw/package.json +29 -0
  24. package/node_modules/pi-mono-clear/CHANGELOG.md +180 -0
  25. package/node_modules/pi-mono-clear/README.md +40 -0
  26. package/node_modules/pi-mono-clear/index.ts +45 -0
  27. package/node_modules/pi-mono-clear/package.json +29 -0
  28. package/node_modules/pi-mono-context/CHANGELOG.md +12 -0
  29. package/node_modules/pi-mono-context/README.md +74 -0
  30. package/node_modules/pi-mono-context/index.ts +641 -0
  31. package/node_modules/pi-mono-context/package.json +29 -0
  32. package/node_modules/pi-mono-context-guard/CHANGELOG.md +195 -0
  33. package/node_modules/pi-mono-context-guard/README.md +81 -0
  34. package/node_modules/pi-mono-context-guard/index.ts +212 -0
  35. package/node_modules/pi-mono-context-guard/package.json +23 -0
  36. package/node_modules/pi-mono-figma/CHANGELOG.md +59 -0
  37. package/node_modules/pi-mono-figma/README.md +236 -0
  38. package/node_modules/pi-mono-figma/__tests__/code-connect.test.ts +32 -0
  39. package/node_modules/pi-mono-figma/__tests__/figma-assets.test.ts +38 -0
  40. package/node_modules/pi-mono-figma/__tests__/figma-component-hints.test.ts +23 -0
  41. package/node_modules/pi-mono-figma/__tests__/figma-implementation-layout.test.ts +47 -0
  42. package/node_modules/pi-mono-figma/__tests__/figma-search.test.ts +51 -0
  43. package/node_modules/pi-mono-figma/__tests__/figma-summarizer.test.ts +65 -0
  44. package/node_modules/pi-mono-figma/__tests__/fixtures/complex-auto-layout.json +115 -0
  45. package/node_modules/pi-mono-figma/__tests__/fixtures/component-instance.json +50 -0
  46. package/node_modules/pi-mono-figma/__tests__/fixtures/hidden-and-vectors.json +28 -0
  47. package/node_modules/pi-mono-figma/__tests__/fixtures/variables-and-styles.json +40 -0
  48. package/node_modules/pi-mono-figma/docs/live-selection-bridge.md +16 -0
  49. package/node_modules/pi-mono-figma/index.ts +6 -0
  50. package/node_modules/pi-mono-figma/package.json +33 -0
  51. package/node_modules/pi-mono-figma/skills/figma/SKILL.md +143 -0
  52. package/node_modules/pi-mono-figma/src/code-connect.ts +110 -0
  53. package/node_modules/pi-mono-figma/src/figma-assets.ts +146 -0
  54. package/node_modules/pi-mono-figma/src/figma-cache.ts +6 -0
  55. package/node_modules/pi-mono-figma/src/figma-client.ts +471 -0
  56. package/node_modules/pi-mono-figma/src/figma-component-hints.ts +87 -0
  57. package/node_modules/pi-mono-figma/src/figma-implementation.ts +264 -0
  58. package/node_modules/pi-mono-figma/src/figma-schemas.ts +139 -0
  59. package/node_modules/pi-mono-figma/src/figma-search.ts +195 -0
  60. package/node_modules/pi-mono-figma/src/figma-summarizer.ts +673 -0
  61. package/node_modules/pi-mono-figma/src/figma-tokens.ts +57 -0
  62. package/node_modules/pi-mono-figma/src/figma-tools.ts +352 -0
  63. package/node_modules/pi-mono-linear/CHANGELOG.md +44 -0
  64. package/node_modules/pi-mono-linear/README.md +159 -0
  65. package/node_modules/pi-mono-linear/index.ts +6 -0
  66. package/node_modules/pi-mono-linear/package.json +30 -0
  67. package/node_modules/pi-mono-linear/skills/linear/SKILL.md +107 -0
  68. package/node_modules/pi-mono-linear/src/linear-client.ts +339 -0
  69. package/node_modules/pi-mono-linear/src/linear-queries.ts +101 -0
  70. package/node_modules/pi-mono-linear/src/linear-schemas.ts +90 -0
  71. package/node_modules/pi-mono-linear/src/linear-tools.ts +362 -0
  72. package/node_modules/pi-mono-loop/CHANGELOG.md +163 -0
  73. package/node_modules/pi-mono-loop/README.md +54 -0
  74. package/node_modules/pi-mono-loop/index.ts +291 -0
  75. package/node_modules/pi-mono-loop/package.json +26 -0
  76. package/node_modules/pi-mono-multi-edit/CHANGELOG.md +232 -0
  77. package/node_modules/pi-mono-multi-edit/README.md +244 -0
  78. package/node_modules/pi-mono-multi-edit/__tests__/classic.test.ts +277 -0
  79. package/node_modules/pi-mono-multi-edit/__tests__/diff.test.ts +77 -0
  80. package/node_modules/pi-mono-multi-edit/__tests__/patch.test.ts +287 -0
  81. package/node_modules/pi-mono-multi-edit/benchmark-edits.ts +966 -0
  82. package/node_modules/pi-mono-multi-edit/classic.ts +435 -0
  83. package/node_modules/pi-mono-multi-edit/diff.ts +143 -0
  84. package/node_modules/pi-mono-multi-edit/index.ts +266 -0
  85. package/node_modules/pi-mono-multi-edit/package.json +37 -0
  86. package/node_modules/pi-mono-multi-edit/patch.ts +463 -0
  87. package/node_modules/pi-mono-multi-edit/types.ts +53 -0
  88. package/node_modules/pi-mono-multi-edit/workspace.ts +85 -0
  89. package/node_modules/pi-mono-review/CHANGELOG.md +190 -0
  90. package/node_modules/pi-mono-review/README.md +30 -0
  91. package/node_modules/pi-mono-review/common.ts +930 -0
  92. package/node_modules/pi-mono-review/index.ts +8 -0
  93. package/node_modules/pi-mono-review/package.json +29 -0
  94. package/node_modules/pi-mono-review/review-tui.ts +194 -0
  95. package/node_modules/pi-mono-review/review.ts +119 -0
  96. package/node_modules/pi-mono-review/reviewer.ts +339 -0
  97. package/node_modules/pi-mono-sentinel/CHANGELOG.md +158 -0
  98. package/node_modules/pi-mono-sentinel/README.md +87 -0
  99. package/node_modules/pi-mono-sentinel/__tests__/output-scanner.test.ts +109 -0
  100. package/node_modules/pi-mono-sentinel/__tests__/permissions.test.ts +202 -0
  101. package/node_modules/pi-mono-sentinel/__tests__/whitelist.test.ts +59 -0
  102. package/node_modules/pi-mono-sentinel/guards/execution-tracker.ts +281 -0
  103. package/node_modules/pi-mono-sentinel/guards/output-scanner.ts +232 -0
  104. package/node_modules/pi-mono-sentinel/guards/permission-gate.ts +170 -0
  105. package/node_modules/pi-mono-sentinel/index.ts +43 -0
  106. package/node_modules/pi-mono-sentinel/package.json +26 -0
  107. package/node_modules/pi-mono-sentinel/patterns/permissions.ts +175 -0
  108. package/node_modules/pi-mono-sentinel/patterns/read-targets.ts +104 -0
  109. package/node_modules/pi-mono-sentinel/patterns/secrets.ts +143 -0
  110. package/node_modules/pi-mono-sentinel/session.ts +95 -0
  111. package/node_modules/pi-mono-sentinel/specs/2026/04/sentinel/001-permission-gate.md +145 -0
  112. package/node_modules/pi-mono-sentinel/types.ts +39 -0
  113. package/node_modules/pi-mono-sentinel/whitelist.ts +86 -0
  114. package/node_modules/pi-mono-simplify/CHANGELOG.md +163 -0
  115. package/node_modules/pi-mono-simplify/README.md +56 -0
  116. package/node_modules/pi-mono-simplify/index.ts +78 -0
  117. package/node_modules/pi-mono-simplify/package.json +29 -0
  118. package/node_modules/pi-mono-status-line/CHANGELOG.md +180 -0
  119. package/node_modules/pi-mono-status-line/README.md +96 -0
  120. package/node_modules/pi-mono-status-line/basic.ts +89 -0
  121. package/node_modules/pi-mono-status-line/expert.ts +689 -0
  122. package/node_modules/pi-mono-status-line/index.ts +54 -0
  123. package/node_modules/pi-mono-status-line/package.json +29 -0
  124. package/node_modules/pi-mono-team-mode/CHANGELOG.md +278 -0
  125. package/node_modules/pi-mono-team-mode/README.md +246 -0
  126. package/node_modules/pi-mono-team-mode/__tests__/agent-manager-transient.test.ts +75 -0
  127. package/node_modules/pi-mono-team-mode/__tests__/delegation-manager.test.ts +118 -0
  128. package/node_modules/pi-mono-team-mode/__tests__/formatters.test.ts +104 -0
  129. package/node_modules/pi-mono-team-mode/__tests__/model-config.test.ts +272 -0
  130. package/node_modules/pi-mono-team-mode/__tests__/notification-box.test.ts +34 -0
  131. package/node_modules/pi-mono-team-mode/__tests__/parallel-utils.test.ts +32 -0
  132. package/node_modules/pi-mono-team-mode/__tests__/pi-stream-parser.test.ts +64 -0
  133. package/node_modules/pi-mono-team-mode/__tests__/prompts.test.ts +106 -0
  134. package/node_modules/pi-mono-team-mode/__tests__/store.test.ts +164 -0
  135. package/node_modules/pi-mono-team-mode/__tests__/tasks.test.ts +267 -0
  136. package/node_modules/pi-mono-team-mode/__tests__/teammate-specs.test.ts +114 -0
  137. package/node_modules/pi-mono-team-mode/__tests__/widget.test.ts +41 -0
  138. package/node_modules/pi-mono-team-mode/__tests__/worktree.test.ts +78 -0
  139. package/node_modules/pi-mono-team-mode/core/chain-utils.ts +90 -0
  140. package/node_modules/pi-mono-team-mode/core/fs-utils.ts +44 -0
  141. package/node_modules/pi-mono-team-mode/core/model-config.ts +432 -0
  142. package/node_modules/pi-mono-team-mode/core/parallel-utils.ts +48 -0
  143. package/node_modules/pi-mono-team-mode/core/prompts.ts +158 -0
  144. package/node_modules/pi-mono-team-mode/core/store.ts +156 -0
  145. package/node_modules/pi-mono-team-mode/core/tasks.ts +99 -0
  146. package/node_modules/pi-mono-team-mode/core/teammate-specs.ts +124 -0
  147. package/node_modules/pi-mono-team-mode/core/types.ts +160 -0
  148. package/node_modules/pi-mono-team-mode/index.ts +825 -0
  149. package/node_modules/pi-mono-team-mode/managers/agent-manager.ts +654 -0
  150. package/node_modules/pi-mono-team-mode/managers/delegation-manager.ts +211 -0
  151. package/node_modules/pi-mono-team-mode/managers/task-manager.ts +238 -0
  152. package/node_modules/pi-mono-team-mode/managers/team-manager.ts +59 -0
  153. package/node_modules/pi-mono-team-mode/package.json +33 -0
  154. package/node_modules/pi-mono-team-mode/runtime/pi-stream-parser.ts +194 -0
  155. package/node_modules/pi-mono-team-mode/runtime/subprocess.ts +183 -0
  156. package/node_modules/pi-mono-team-mode/runtime/transient-session.ts +196 -0
  157. package/node_modules/pi-mono-team-mode/runtime/worktree.ts +90 -0
  158. package/node_modules/pi-mono-team-mode/ui/formatters.ts +149 -0
  159. package/node_modules/pi-mono-team-mode/ui/notification-box.ts +55 -0
  160. package/node_modules/pi-mono-team-mode/ui/widget.ts +94 -0
  161. package/package.json +76 -0
@@ -0,0 +1,29 @@
1
+ {
2
+ "name": "pi-mono-btw",
3
+ "version": "1.7.2",
4
+ "description": "Pi extension that answers side questions while the main agent keeps running",
5
+ "keywords": [
6
+ "pi-package",
7
+ "pi-extension"
8
+ ],
9
+ "peerDependencies": {
10
+ "@mariozechner/pi-ai": "*",
11
+ "@mariozechner/pi-coding-agent": "*",
12
+ "@mariozechner/pi-tui": "*",
13
+ "@sinclair/typebox": "*"
14
+ },
15
+ "pi": {
16
+ "extensions": [
17
+ "./index.ts"
18
+ ]
19
+ },
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "git+https://github.com/emanuelcasco/pi-mono-extensions.git",
23
+ "directory": "extensions/btw"
24
+ },
25
+ "bugs": {
26
+ "url": "https://github.com/emanuelcasco/pi-mono-extensions/issues"
27
+ },
28
+ "homepage": "https://github.com/emanuelcasco/pi-mono-extensions#readme"
29
+ }
@@ -0,0 +1,180 @@
1
+ # pi-mono-clear
2
+
3
+ ## 1.7.2
4
+
5
+ ### Patch Changes
6
+
7
+ ### Fixed: ask-user-question
8
+
9
+ - Remove unused `StringEnum` import from `@mariozechner/pi-ai`.
10
+
11
+
12
+ ## 1.7.1
13
+
14
+ ### Patch Changes
15
+
16
+ ### Fixed: team-mode
17
+
18
+ - Widget no longer mislabels blocked or approval-pending teams as "running smoothly" — blockers and pending approvals are now detected via team summaries.
19
+ - Preserve in-flight work on re-emitted `session_start` events instead of tearing the runtime down and SIGTERM-ing live teammates.
20
+ - Auto-relaunch leaders for `running` teams after a session reset; surface failures as both a team signal and a UI notification.
21
+ - `createTeam` now defaults `repoRoots` to `[process.cwd()]` when the caller passes an empty array.
22
+ - Archive `process.json` into `history/` before a new task reuses the same role slot, so the prior task's final state is no longer silently clobbered.
23
+
24
+ ### Enhanced: team-mode
25
+
26
+ - Durable intent queue for subprocess handoff: `team_spawn_teammate` calls made from a teammate subprocess are written to disk and executed by the main session's `LeaderRuntime` instead of spawning orphaned grand-children.
27
+ - New tool `team_task_create_batch` lets the leader emit the full initial task DAG in one call, removing per-task LLM round-trips during bootstrap.
28
+ - `team_create` / `launchLeader` accept an `awaitBootstrap` option so the user sees the task graph before the tool returns; leader launch retries up to 3 times on transient failures.
29
+ - Persist per-turn debug artifacts (prompt, invocation, stderr, raw event stream) for both leader and teammate subprocesses, exposed via `TeammateSummary.debugArtifacts`.
30
+ - Track `exitCode`, `exitSignal`, `terminationReason`, `stderrTail`, `toolExecutions`, `model` and `modelProvider` on every `TeammateProcess` record.
31
+ - Provider detection now consults pi's `settings.json` and `auth.json` in addition to env vars; default model IDs aligned with the provider/model scheme.
32
+ - `collectPiOutput` supports `AbortSignal` cancellation.
33
+
34
+ ### Tests
35
+
36
+ - New `intent-queue` and `model-config` suites; expanded coverage across `leader-runtime`, `team-manager`, `team-query-tool` and `formatters`.
37
+
38
+
39
+ ## 1.7.0
40
+
41
+ ### Minor Changes
42
+
43
+ ### Enhanced: status-line
44
+
45
+ - Improved progress rendering and colors in expert mode
46
+
47
+ ### Enhanced: team-mode
48
+
49
+ - **LLM-driven leader** — replaced the hardcoded `research → synthesis → implementation → verification` state machine with a pi subprocess coordinator that authors the task graph via tool calls
50
+ - **New tool `team_task_create`** so the leader can author tasks at runtime
51
+ - **New tool `team_handoff`** for explicit teammate → teammate context handoffs (replaces regex-scraping of `Handoffs:` output sections)
52
+ - **File-based teammate specs** — drop `.claude/teammates/<role>.md` frontmatter files (`name`, `description`, `needsWorktree`, `hasMemory`, `modelTier`) to extend or override the seven built-in roles
53
+ - **Event-driven leader wakes** — mailbox messages addressed to the leader (or broadcast) trigger a debounced (~200ms) cycle instead of waiting for the 20s polling tick
54
+ - **Templates accept any string** — `fullstack` / `research` / `refactor` remain as built-ins, but unknown template keys are accepted and no-op gracefully
55
+ - **Provider config per team** — per-team model overrides via `/team models`
56
+ - Reduced leader overhead and parent-session token churn
57
+ - `spawnTeammate` now always appends the full runtime-built context (signals, mailbox, dependencies, team memory) so teammates get the richer snapshot even when the caller's `context` argument is brief
58
+
59
+ ### Breaking changes: team-mode
60
+
61
+ - Removed `LeaderPhase` enum and `currentPhase` field from `TeamRecord` / `TeamSummary`
62
+ - Removed `parseExplicitHandoffs` export and the legacy `Handoffs:` output parser — peer handoffs must go through the `team_handoff` tool
63
+ - Removed the deterministic auto-spawn loop (`ensureBootstrapTasks`) — all task authoring and teammate spawning is now the LLM leader's responsibility
64
+ - Removed `StringEnum` gate on `team_create`'s `template` parameter (now plain string)
65
+
66
+ ### Fixed: review
67
+
68
+ - Annotate diff lines so the model picks correct line numbers
69
+ - Fix slice chunk around lines for comments in the reviewer TUI
70
+
71
+ ### Documentation
72
+
73
+ - Updated root README and sentinel extension README
74
+ - Documented the new file-based teammate spec format and event-driven leader wake in the team-mode README
75
+
76
+ ## 1.6.0
77
+
78
+ ### Minor Changes
79
+
80
+ ### New Extension: sentinel
81
+
82
+ Replaced the `grep` extension with a new security-focused `sentinel` extension for monitoring and guarding sensitive operations.
83
+
84
+ ### Enhanced: team-mode
85
+
86
+ - Added comprehensive test suite with integration tests
87
+ - New mock helpers for subprocess testing
88
+ - Improved signal manager with better error handling
89
+ - Leader runtime refactoring for stability
90
+ - Team query tool with dedicated tests
91
+
92
+ ### Enhanced: status-line
93
+
94
+ - Added basic and expert mode displays
95
+ - Improved index.ts with better state management
96
+
97
+ ### Enhanced: clear
98
+
99
+ - Updated keyboard shortcut to `Ctrl+Shift+L`
100
+ - Better busy-state handling for shortcuts
101
+ - Added warning/cancel handling and error notifications
102
+
103
+ ### Enhanced: context-guard
104
+
105
+ - Improved read deduplication across sessions
106
+ - Added `context-guard:file-modified` event for cache eviction
107
+
108
+ ### Documentation
109
+
110
+ - Added dedicated README for `clear` extension
111
+ - Added dedicated README for `context-guard` extension
112
+ - Updated main README with improved extension descriptions
113
+
114
+ ## 1.5.0
115
+
116
+ ### Minor Changes
117
+
118
+ - ### `multi-edit` — diverge from upstream fork
119
+
120
+ The extension was originally derived from [mitsuhiko/agent-stuff](https://github.com/mitsuhiko/agent-stuff)'s `pi-extensions/multi-edit.ts`. This release rewrites the largest unmodified subsystems so the implementation is structurally distinct from upstream while keeping the public contract intact.
121
+
122
+ - **Modularized layout** — the 953-line `index.ts` is split into purpose-scoped modules: `types.ts`, `workspace.ts`, `classic.ts`, `patch.ts`, `diff.ts`, and a slim `index.ts` (~180 lines of registration + dispatch wiring).
123
+ - **New patch engine** — `patch.ts` is now a recursive-descent parser over a `LineCursor` class with `indexOf`-based hunk anchoring. Hunks are stored as `{ oldBlock, newBlock }` raw strings (previously `{ oldLines[], newLines[] }` arrays), letting the applier splice content directly instead of reconstructing line arrays per apply.
124
+ - **Two-pass diff renderer** — `diff.ts` now walks `diffLines` parts into a typed `Entry[]` stream and makes all gutter / context-collapse decisions in a second pass, replacing the prior single-loop state-flag design.
125
+ - **Polished classic edits** — extracted `groupEditsByPath`, `sortGroupByPosition`, `applyGroupToContent`, and `rollbackSnapshots` helpers; formalized the quote-fallback as an ordered `MATCH_PASSES` array so new normalizers (dashes, NBSP, etc.) can be added by appending one entry.
126
+ - **First contract test suite** — 34 tests under `__tests__/` cover classic edits (positional reordering, redundant-pair skip, quote fallback, atomic rollback, read-only preflight), patch operations (Add/Delete/Update round-trips, move-rejection, multi-op batches), and diff rendering (line-number gutter, context collapse, add/remove-only cases). Runs via `npm test` (`tsx --test`).
127
+ - **Dropped Codex apply_patch edge cases** (documented in `README.md` → "Codex apply_patch compatibility"): `*** End of File` sentinel hunks, 4-pass fuzzy `seekSequence` matching, implicit first hunk without `@@`, whitespace-tolerant anchoring. Common paths (Add/Delete/Update-single-chunk, Update with multiple hunks, Add+Update+Delete batches) are fully tested and preserved.
128
+ - **README attribution** — new "Origins" section crediting `mitsuhiko/agent-stuff` as the original source.
129
+
130
+ ## 1.4.0
131
+
132
+ ### Minor Changes
133
+
134
+ - Add teammate progress heartbeats and widget refresh improvements to team mode.
135
+
136
+ ## 1.3.0
137
+
138
+ ## 1.2.0
139
+
140
+ ### Minor Changes
141
+
142
+ - ### `multi-edit` — robustness improvements
143
+
144
+ - **No-op write guard**: skip file write and `context-guard:file-modified` event when new content is identical to what was last read — prevents unnecessary watcher churn
145
+ - **Early write-access check**: virtual workspace `checkWriteAccess` now validates real-filesystem permissions during the preflight pass so read-only files fail fast before any real file is touched
146
+ - **Curly-quote normalization**: new `findActualString` helper falls back to normalized quote matching (`"` / `'` ↔ `"` / `'`) when exact `oldText` search fails — the most common class of preflight mismatch
147
+ - **Atomic batch rollback**: `applyClassicEdits` gains a `rollbackOnError` option that restores all successfully written files when a later edit in the same batch fails
148
+
149
+ ### `ask-user-question` — UX fixes
150
+
151
+ - **Reliable text capture on submit**: answer is read directly from the editor before it clears itself, fixing a race where the stored value was always empty
152
+ - **Unified advance logic**: `advanceTab()` and `saveOtherModeText()` helpers replace scattered single-question fast-paths — behaviour is now consistent regardless of form length
153
+ - **Auto-advance on Enter / Tab**: pressing Enter or Tab in any question (text, radio with "Other", checkbox with "Other") advances to the next tab without requiring a separate click
154
+
155
+ ### `team-mode` — stability fixes
156
+
157
+ - **Infinite retry loop eliminated**: subprocess guard (`PI_TEAM_SUBPROCESS=1`) prevents spawned pi subprocesses from launching a ghost `LeaderRuntime` that immediately marks in-progress tasks as stalled
158
+ - **Stall detection grace period**: tasks updated within the last 2 × `LEADER_POLL_MS` (10 s) are skipped by `detectStalledTasks` — eliminates false positives on the spawning cycle
159
+ - **Circuit breaker**: tasks that stall more than `MAX_TASK_RETRIES` (3) times are permanently cancelled with a clear error signal instead of being silently re-queued
160
+ - **Concurrent cycle guard**: `runLeaderCycle` returns early if a cycle is already in-flight for the same team, preventing overlapping read-modify-write from the poll interval and completion handlers
161
+ - **Widget cleanup**: cancelled and completed teams are no longer shown in the team widget — only `initializing | running | paused | failed` states are displayed
162
+ - **Shorter auto-generated names**: `objectiveToName` now splits on non-alphanumeric characters (handles path separators), filters stopwords and extreme-length tokens, and hard-caps at 32 characters
163
+
164
+ ## 1.1.1
165
+
166
+ ### Patch Changes
167
+
168
+ - chore: update all packages for consistency and include team-mode fixes
169
+
170
+ ## 1.1.0
171
+
172
+ ## 1.0.0
173
+
174
+ ### Major Changes
175
+
176
+ - 199c367: First version of the extensions to upload to GitHub
177
+
178
+ ### Patch Changes
179
+
180
+ - Bump all packages to 0.1.1
@@ -0,0 +1,40 @@
1
+ # clear extension
2
+
3
+ Adds a `/clear` command that starts a fresh pi session, similar to the built-in `/new` command.
4
+
5
+ ## Usage
6
+
7
+ ```text
8
+ /clear
9
+ ```
10
+
11
+ ## Keyboard shortcut
12
+
13
+ ```text
14
+ Ctrl+Shift+L
15
+ ```
16
+
17
+ The shortcut sends `/clear` as a command. If the agent is busy, it is delivered as a follow-up so the current turn can finish first.
18
+
19
+ ## Behavior
20
+
21
+ When `/clear` runs, the extension:
22
+
23
+ 1. waits for the agent to become idle if needed
24
+ 2. starts a new session
25
+ 3. shows a warning if the new-session request is cancelled
26
+ 4. shows an error notification if clearing fails
27
+
28
+ This makes it a convenient "start fresh" action without manually typing `/new`.
29
+
30
+ ## Notes
31
+
32
+ - `/clear` is intentionally lightweight and just wraps pi's session reset behavior
33
+ - if no UI is available, the keyboard shortcut does nothing
34
+ - the command itself works without needing the shortcut
35
+
36
+ ## Files
37
+
38
+ - `index.ts` — extension entry point
39
+ - `package.json` — package metadata
40
+ - `CHANGELOG.md` — release history
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Clear — starts a fresh session, similar to the built-in /new command.
3
+ *
4
+ * Usage:
5
+ * /clear — start a new session (waits for agent to finish first)
6
+ * Ctrl+Shift+L — keyboard shortcut for /clear
7
+ */
8
+
9
+ import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
10
+
11
+ export default function (pi: ExtensionAPI) {
12
+ async function clearSession(ctx: Parameters<Parameters<typeof pi.registerCommand>[1]["handler"]>[1]) {
13
+ try {
14
+ if (!ctx.isIdle()) {
15
+ await ctx.waitForIdle();
16
+ }
17
+
18
+ const result = await ctx.newSession();
19
+
20
+ if (result.cancelled) {
21
+ ctx.ui.notify("Clear cancelled by extension", "warning");
22
+ }
23
+ } catch (err) {
24
+ ctx.ui.notify(`Clear failed: ${err instanceof Error ? err.message : String(err)}`, "error");
25
+ }
26
+ }
27
+
28
+ pi.registerCommand("clear", {
29
+ description: "Start a fresh session (like /new)",
30
+ handler: async (_args, ctx) => {
31
+ await clearSession(ctx);
32
+ },
33
+ });
34
+
35
+ pi.registerShortcut("ctrl+shift+l", {
36
+ description: "Clear session and start fresh",
37
+ handler: async (ctx) => {
38
+ if (!ctx.hasUI) return;
39
+
40
+ // Shortcuts get ExtensionContext, not ExtensionCommandContext,
41
+ // so we send /clear as a command instead.
42
+ pi.sendUserMessage("/clear", ctx.isIdle() ? undefined : { deliverAs: "followUp" });
43
+ },
44
+ });
45
+ }
@@ -0,0 +1,29 @@
1
+ {
2
+ "name": "pi-mono-clear",
3
+ "version": "1.7.2",
4
+ "description": "Pi extension that starts a fresh session with /clear",
5
+ "keywords": [
6
+ "pi-package",
7
+ "pi-extension"
8
+ ],
9
+ "peerDependencies": {
10
+ "@mariozechner/pi-ai": "*",
11
+ "@mariozechner/pi-coding-agent": "*",
12
+ "@mariozechner/pi-tui": "*",
13
+ "@sinclair/typebox": "*"
14
+ },
15
+ "pi": {
16
+ "extensions": [
17
+ "./index.ts"
18
+ ]
19
+ },
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "git+https://github.com/emanuelcasco/pi-mono-extensions.git",
23
+ "directory": "extensions/clear"
24
+ },
25
+ "bugs": {
26
+ "url": "https://github.com/emanuelcasco/pi-mono-extensions/issues"
27
+ },
28
+ "homepage": "https://github.com/emanuelcasco/pi-mono-extensions#readme"
29
+ }
@@ -0,0 +1,12 @@
1
+ # pi-mono-context
2
+
3
+ ## 0.1.0
4
+
5
+ ### Patch Changes
6
+
7
+ ### New Extension: context
8
+
9
+ - Add `/context` command for a Claude Code-style context usage report printed in the conversation.
10
+ - Filter generated context reports out of future LLM context while keeping them visible in the transcript.
11
+ - Render generated reports with the requested category palette: grey system prompts/tools/free space, light-blue custom agents, orange memory files, yellow skills, and purple messages.
12
+ - Show total context usage from Pi plus estimated category breakdowns, extension allocation by source/package, session stats, active tools, and command sections.
@@ -0,0 +1,74 @@
1
+ # pi-mono-context
2
+
3
+ `pi-mono-context` adds a Claude Code-style `/context` command to Pi for printing the current session's context-window usage in the conversation without adding that report to future LLM context.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ pi install npm:pi-mono-context
9
+ ```
10
+
11
+ Or load locally while developing:
12
+
13
+ ```bash
14
+ pi -e /path/to/pi-extensions/extensions/context/index.ts
15
+ ```
16
+
17
+ ## Usage
18
+
19
+ ```text
20
+ /context
21
+ ```
22
+
23
+ The command prints a display-only custom message with:
24
+
25
+ - a dense colored grid representing used vs free context
26
+ - current model and total token usage
27
+ - estimated usage by category
28
+ - session stats such as turns, message count, cache read/write, and cost
29
+ - estimated extension allocation grouped by source/package
30
+ - active tool and slash-command sections when Pi exposes them cheaply
31
+
32
+ The printed report is filtered out by the extension's `context` hook before LLM calls, so it is visible in the transcript but does not consume future context window.
33
+
34
+ ## Example
35
+
36
+ ```text
37
+ Context Usage
38
+ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛁ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ Opus 4.7 (1m context)
39
+ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ claude-opus-4-7[1m]
40
+ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ 30.6k/1m tokens (3%)
41
+ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶
42
+ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ Estimated usage by category
43
+ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛁ System prompts: 9k tokens (0.9%)
44
+ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛶ ⛁ System tools: 13k tokens (1.3%)
45
+ ⛁ Messages: 13 tokens (0.0%)
46
+ ⛶ Free space: 969.4k tokens (96.9%)
47
+ ```
48
+
49
+ ## Extension allocation
50
+
51
+ The report includes an `Extension allocation · estimated` section when Pi exposes source metadata. Allocation is grouped from active tool definitions, extension/skill commands, and custom messages by `sourceInfo` or `customType`.
52
+
53
+ ```text
54
+ Extension allocation · estimated
55
+ ├ figma: 4.8k tokens (0.5%) · tools 4.2k · commands 600 · custom 0
56
+ ├ linear: 3.1k tokens (0.3%) · tools 2.7k · commands 400 · custom 0
57
+ └ context: 0 tokens (0.0%) · tools 0 · commands 0 · custom 0
58
+ ```
59
+
60
+ This is an estimate, not exact provider-tokenized accounting.
61
+
62
+ ## Color palette
63
+
64
+ - `⛁ System prompts`: grey
65
+ - `⛁ System tools`: grey
66
+ - `⛁ Custom agents`: light blue
67
+ - `⛁ Memory files`: orange
68
+ - `⛁ Skills`: yellow
69
+ - `⛁ Messages`: purple
70
+ - `⛶ Free space`: grey
71
+
72
+ ## Notes
73
+
74
+ Pi exposes the real total context usage via `ctx.getContextUsage()`. The category breakdown is a best-effort estimate based on session entries, system prompt text, active tool definitions, and simple token heuristics. Exact provider tokenization may differ.