@lebronj/pi-suite 0.1.10 → 0.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +39 -10
- package/extensions/autogoal.ts +1302 -0
- package/package.json +1 -1
- package/scripts/bootstrap.sh +4 -0
- package/skills/pi-skill/SKILL.md +19 -5
- package/extensions/redraws.ts +0 -24
- package/extensions/simple-replies.ts +0 -10
- package/skills/leetcode-array/SKILL.md +0 -40
- package/skills/leetcode-array/problems/best_time_to_buy_and_sell_stock.py +0 -19
- package/skills/leetcode-array/problems/product_of_array_except_self.py +0 -22
- package/skills/leetcode-array/problems/two_sum.py +0 -19
- package/skills/weather/SKILL.md +0 -49
package/package.json
CHANGED
package/scripts/bootstrap.sh
CHANGED
package/skills/pi-skill/SKILL.md
CHANGED
|
@@ -18,6 +18,7 @@ When adding, removing, renaming, or materially changing any pi capability in thi
|
|
|
18
18
|
- `edit`: precise exact-text replacements in one file.
|
|
19
19
|
- `write`: create or overwrite files.
|
|
20
20
|
- `goal`: inspect, resume/drop, or complete an active goal-mode objective when goal mode is running.
|
|
21
|
+
- `autogoal`: inspect, checkpoint, pause/resume/drop, block, or complete an active bounded autogoal run when `/autogoal` is running.
|
|
21
22
|
- `lsp_diagnostics` / `lsp_navigation`: code-intelligence path for diagnostics, definitions, references, hover, symbols, call hierarchy, rename, and workspace diagnostics when pi-lens/LSP tools are installed.
|
|
22
23
|
- `ast_grep_search` / `ast_grep_replace` / `ast_dump`: AST-aware code search and replacement when pi-lens tools are installed; prefer over raw text search for structural code patterns.
|
|
23
24
|
- `lens_diagnostics`: inspect pi-lens warnings/errors for files touched this session when available.
|
|
@@ -170,6 +171,19 @@ mcp({ tool: "tool_name", args: "{}" })
|
|
|
170
171
|
|
|
171
172
|
Do not route built-in pi tools through MCP; call them directly.
|
|
172
173
|
|
|
174
|
+
## Autogoal
|
|
175
|
+
|
|
176
|
+
Autogoal is provided by `autogoal.ts`.
|
|
177
|
+
|
|
178
|
+
- Start with `/autogoal <task>`.
|
|
179
|
+
- It persists the objective, injects hidden loop context, enables the `autogoal` tool, and auto-continues until verified complete, paused, dropped, blocked, or interrupted.
|
|
180
|
+
- It uses bounded loop defaults: 12 autonomous turns per session, 2 no-progress turns, 3 repeated repair attempts, and 4 subagent jobs per run.
|
|
181
|
+
- Context thresholds are 60% prepare, 75% checkpoint, and 85% checkpoint plus automatic new-session continuation.
|
|
182
|
+
- Completion is gated by current-state evidence: changed files must be read after edits and a relevant validation command must pass before `autogoal({ op: "complete" })` succeeds.
|
|
183
|
+
- Subagents are optional; scout/reviewer/verifier are allowed when useful, while worker subagents must use isolated worktrees.
|
|
184
|
+
- Run artifacts are audit-only and live under `~/.pi/agent/workflow-runs/autogoal-<run-id>/`; checkpoints also live under `~/.pi/agent/autogoal/checkpoints/`.
|
|
185
|
+
- Useful commands: `/autogoal status`, `/autogoal pause`, `/autogoal resume`, `/autogoal checkpoint`, `/autogoal drop`, `/autogoal auto on`, `/autogoal auto off`.
|
|
186
|
+
|
|
173
187
|
## Goal Mode
|
|
174
188
|
|
|
175
189
|
Goal mode is provided by `goal-mode.ts`.
|
|
@@ -192,7 +206,6 @@ The pet extension provides a small terminal companion and durable profile.
|
|
|
192
206
|
## UI And Utility Extensions
|
|
193
207
|
|
|
194
208
|
- `prompt-url-widget.ts`: detects PR/issue prompt templates, fetches GitHub metadata with `gh`, shows a widget, and names the session when possible.
|
|
195
|
-
- `redraws.ts`: `/tui` shows TUI full redraw stats.
|
|
196
209
|
- `snake.ts`: `/snake` opens a TUI snake game; `Esc` pauses/saves, `q` quits, arrows/WASD move.
|
|
197
210
|
- `tps.ts`: after each assistant run, shows tokens-per-second and token usage details.
|
|
198
211
|
- `memory-curator.ts`: deprecated compatibility notice only; external curation is managed by pi-memory service tools.
|
|
@@ -203,12 +216,11 @@ Suite skills currently include:
|
|
|
203
216
|
|
|
204
217
|
- `add-llm-provider`: checklist for adding providers to `packages/ai`.
|
|
205
218
|
- `image-to-editable-ppt-slide`: rebuild reference images as editable PowerPoint slides.
|
|
206
|
-
- `leetcode-array`: array problem patterns and Python references.
|
|
207
|
-
- `weather`: current weather and forecasts using no-key services.
|
|
208
219
|
- `pi-skill`: this capability index.
|
|
209
220
|
|
|
210
221
|
Optional package-provided skills can include:
|
|
211
222
|
|
|
223
|
+
- `figma`: Figma REST/API design exploration and design-to-code workflows from `pi-mono-figma`; not installed or loaded by default, enabled with `pi install npm:pi-mono-figma`.
|
|
212
224
|
- `librarian`: library internals research with source citations.
|
|
213
225
|
- `pi-subagents`: subagent delegation workflows.
|
|
214
226
|
- `ast-grep`: AST-aware code search/replace guidance.
|
|
@@ -231,11 +243,12 @@ Global user package configuration is in `~/.pi/agent/settings.json`; project pac
|
|
|
231
243
|
|
|
232
244
|
Current suite package:
|
|
233
245
|
|
|
234
|
-
- `@lebronj/pi-suite`: bundles local extensions, prompts, suite skills, vendored `@jhp/pi-memory`, and optional package hooks for `pi-mcp-adapter`, `pi-subagents`, and `pi-web-access`.
|
|
246
|
+
- `@lebronj/pi-suite`: bundles local extensions, prompts, suite skills, vendored `@jhp/pi-memory`, and optional package hooks for `pi-mcp-adapter`, `pi-subagents`, and `pi-web-access`. It does not install or load `pi-mono-figma` by default.
|
|
235
247
|
|
|
236
248
|
Common project packages:
|
|
237
249
|
|
|
238
250
|
- `@jhp/pi-memory`
|
|
251
|
+
- `pi-mono-figma` (install and enable only on demand with `pi install npm:pi-mono-figma`)
|
|
239
252
|
- `pi-web-access`
|
|
240
253
|
- `pi-mcp-adapter`
|
|
241
254
|
- `pi-subagents`
|
|
@@ -246,7 +259,8 @@ Bootstrap behavior:
|
|
|
246
259
|
- Installs global `@earendil-works/pi-coding-agent`.
|
|
247
260
|
- Writes the team OpenAI-compatible provider to `~/.pi/agent/models.json`.
|
|
248
261
|
- Sets default provider/model in `~/.pi/agent/settings.json`.
|
|
249
|
-
- Runs `pi install npm:@lebronj/pi-suite` by default
|
|
262
|
+
- Runs `pi install npm:@lebronj/pi-suite` by default; this does not install or load `pi-mono-figma`.
|
|
263
|
+
- Prints follow-up instructions for enabling Figma later with `pi install npm:pi-mono-figma` and disabling it with `pi remove npm:pi-mono-figma`.
|
|
250
264
|
- Creates `~/.pi/agent/memory` and links it into the workspace `.pi/memory` when safe.
|
|
251
265
|
- Optionally initializes the local `~/.pi/agent/evolution` repo for memory/skill-draft snapshots; it never writes tokens or enables auto-push.
|
|
252
266
|
- Links suite skills into the workspace `.pi/skills` when safe.
|
package/extensions/redraws.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Redraws Extension
|
|
3
|
-
*
|
|
4
|
-
* Exposes /tui to show TUI redraw stats.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
8
|
-
import { Text } from "@earendil-works/pi-tui";
|
|
9
|
-
|
|
10
|
-
export default function (pi: ExtensionAPI) {
|
|
11
|
-
pi.registerCommand("tui", {
|
|
12
|
-
description: "Show TUI stats",
|
|
13
|
-
handler: async (_args, ctx) => {
|
|
14
|
-
if (!ctx.hasUI) return;
|
|
15
|
-
let redraws = 0;
|
|
16
|
-
await ctx.ui.custom<void>((tui, _theme, _keybindings, done) => {
|
|
17
|
-
redraws = tui.fullRedraws;
|
|
18
|
-
done(undefined);
|
|
19
|
-
return new Text("", 0, 0);
|
|
20
|
-
});
|
|
21
|
-
ctx.ui.notify(`TUI full redraws: ${redraws}`, "info");
|
|
22
|
-
},
|
|
23
|
-
});
|
|
24
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
2
|
-
|
|
3
|
-
export default function simpleRepliesExtension(pi: ExtensionAPI): void {
|
|
4
|
-
pi.on("before_agent_start", async (event) => {
|
|
5
|
-
if (event.prompt.trim().toLowerCase() !== "hi") return undefined;
|
|
6
|
-
return {
|
|
7
|
-
systemPrompt: `${event.systemPrompt}\n\nFor this turn only, the user's entire message is "hi". Reply exactly: hi`,
|
|
8
|
-
};
|
|
9
|
-
});
|
|
10
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: leetcode-array
|
|
3
|
-
description: Common LeetCode array problems with Python reference solutions. Use when the user wants array practice, standard solution patterns, or quick runnable examples.
|
|
4
|
-
metadata:
|
|
5
|
-
clawdbot:
|
|
6
|
-
emoji: "🧮"
|
|
7
|
-
requires:
|
|
8
|
-
files: ["problems/*.py"]
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
# LeetCode Array
|
|
12
|
-
|
|
13
|
-
Use this skill when the user wants representative LeetCode array exercises with runnable Python solutions.
|
|
14
|
-
|
|
15
|
-
## Included problems
|
|
16
|
-
|
|
17
|
-
- `problems/two_sum.py` - hash map lookup for complement matching
|
|
18
|
-
- `problems/best_time_to_buy_and_sell_stock.py` - one-pass minimum tracking
|
|
19
|
-
- `problems/product_of_array_except_self.py` - prefix and suffix products
|
|
20
|
-
|
|
21
|
-
## How to use
|
|
22
|
-
|
|
23
|
-
Read the matching problem file first, then explain:
|
|
24
|
-
- the core pattern
|
|
25
|
-
- time and space complexity
|
|
26
|
-
- one common mistake
|
|
27
|
-
|
|
28
|
-
Run examples locally if needed:
|
|
29
|
-
|
|
30
|
-
```bash
|
|
31
|
-
python3 problems/two_sum.py
|
|
32
|
-
python3 problems/best_time_to_buy_and_sell_stock.py
|
|
33
|
-
python3 problems/product_of_array_except_self.py
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
## Answering style
|
|
37
|
-
|
|
38
|
-
- Start with the pattern before the code
|
|
39
|
-
- Prefer the runnable Python examples in `problems/`
|
|
40
|
-
- If the user asks for another language, translate from the Python reference solution
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
def max_profit(prices: list[int]) -> int:
|
|
5
|
-
min_price = float("inf")
|
|
6
|
-
best = 0
|
|
7
|
-
|
|
8
|
-
for price in prices:
|
|
9
|
-
if price < min_price:
|
|
10
|
-
min_price = price
|
|
11
|
-
continue
|
|
12
|
-
best = max(best, price - min_price)
|
|
13
|
-
|
|
14
|
-
return best
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
if __name__ == "__main__":
|
|
18
|
-
sample_prices = [7, 1, 5, 3, 6, 4]
|
|
19
|
-
print(max_profit(sample_prices))
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
def product_except_self(nums: list[int]) -> list[int]:
|
|
5
|
-
result = [1] * len(nums)
|
|
6
|
-
|
|
7
|
-
prefix = 1
|
|
8
|
-
for index, value in enumerate(nums):
|
|
9
|
-
result[index] = prefix
|
|
10
|
-
prefix *= value
|
|
11
|
-
|
|
12
|
-
suffix = 1
|
|
13
|
-
for index in range(len(nums) - 1, -1, -1):
|
|
14
|
-
result[index] *= suffix
|
|
15
|
-
suffix *= nums[index]
|
|
16
|
-
|
|
17
|
-
return result
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
if __name__ == "__main__":
|
|
21
|
-
sample_nums = [1, 2, 3, 4]
|
|
22
|
-
print(product_except_self(sample_nums))
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
def two_sum(nums: list[int], target: int) -> list[int]:
|
|
5
|
-
seen: dict[int, int] = {}
|
|
6
|
-
|
|
7
|
-
for index, value in enumerate(nums):
|
|
8
|
-
complement = target - value
|
|
9
|
-
if complement in seen:
|
|
10
|
-
return [seen[complement], index]
|
|
11
|
-
seen[value] = index
|
|
12
|
-
|
|
13
|
-
return []
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
if __name__ == "__main__":
|
|
17
|
-
sample_nums = [2, 7, 11, 15]
|
|
18
|
-
sample_target = 9
|
|
19
|
-
print(two_sum(sample_nums, sample_target))
|
package/skills/weather/SKILL.md
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: weather
|
|
3
|
-
description: Get current weather and forecasts (no API key required).
|
|
4
|
-
homepage: https://wttr.in/:help
|
|
5
|
-
metadata: {"clawdbot":{"emoji":"🌤️","requires":{"bins":["curl"]}}}
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
# Weather
|
|
9
|
-
|
|
10
|
-
Two free services, no API keys needed.
|
|
11
|
-
|
|
12
|
-
## wttr.in (primary)
|
|
13
|
-
|
|
14
|
-
Quick one-liner:
|
|
15
|
-
```bash
|
|
16
|
-
curl -s "wttr.in/London?format=3"
|
|
17
|
-
# Output: London: ⛅️ +8°C
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
Compact format:
|
|
21
|
-
```bash
|
|
22
|
-
curl -s "wttr.in/London?format=%l:+%c+%t+%h+%w"
|
|
23
|
-
# Output: London: ⛅️ +8°C 71% ↙5km/h
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
Full forecast:
|
|
27
|
-
```bash
|
|
28
|
-
curl -s "wttr.in/London?T"
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
Format codes: `%c` condition · `%t` temp · `%h` humidity · `%w` wind · `%l` location · `%m` moon
|
|
32
|
-
|
|
33
|
-
Tips:
|
|
34
|
-
- URL-encode spaces: `wttr.in/New+York`
|
|
35
|
-
- Airport codes: `wttr.in/JFK`
|
|
36
|
-
- Units: `?m` (metric) `?u` (USCS)
|
|
37
|
-
- Today only: `?1` · Current only: `?0`
|
|
38
|
-
- PNG: `curl -s "wttr.in/Berlin.png" -o /tmp/weather.png`
|
|
39
|
-
|
|
40
|
-
## Open-Meteo (fallback, JSON)
|
|
41
|
-
|
|
42
|
-
Free, no key, good for programmatic use:
|
|
43
|
-
```bash
|
|
44
|
-
curl -s "https://api.open-meteo.com/v1/forecast?latitude=51.5&longitude=-0.12¤t_weather=true"
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
Find coordinates for a city, then query. Returns JSON with temp, windspeed, weathercode.
|
|
48
|
-
|
|
49
|
-
Docs: https://open-meteo.com/en/docs
|