pi-extensions 0.1.12 → 0.1.14

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.
@@ -2,6 +2,13 @@
2
2
 
3
3
  All notable changes to this extension will be documented in this file.
4
4
 
5
+ ## [0.1.11] - 2026-01-26
6
+
7
+ ### Changed
8
+ - Require `bat`, `delta`, and `glow` before opening `/files`
9
+ - Add a postinstall reminder for required system tools
10
+ - Document install commands next to the Pi install steps
11
+
5
12
  ## [0.1.10] - 2026-01-26
6
13
 
7
14
  ### Fixed
@@ -12,6 +12,16 @@ In-terminal file browser and diff viewer widget for Pi. Navigate files, view dif
12
12
  pi install npm:@tmustier/pi-files-widget
13
13
  ```
14
14
 
15
+ Required deps (needed for /files):
16
+
17
+ ```bash
18
+ # macOS (Homebrew)
19
+ brew install bat git-delta glow
20
+
21
+ # Ubuntu/Debian
22
+ sudo apt-get install -y bat git-delta glow
23
+ ```
24
+
15
25
  ```bash
16
26
  pi install git:github.com/tmustier/pi-extensions
17
27
  ```
@@ -57,17 +67,13 @@ Then reference it in your settings:
57
67
  }
58
68
  ```
59
69
 
60
- ## Dependencies (recommended)
61
-
62
- ```bash
63
- brew install bat git-delta glow
64
- ```
70
+ ## Dependencies (required)
65
71
 
66
72
  - `bat`: syntax highlighting
67
73
  - `delta`: formatted diffs
68
74
  - `glow`: markdown rendering
69
75
 
70
- If any are missing, the extension will notify you at session start and gracefully fall back to plain rendering.
76
+ The `/files` browser requires these tools and will refuse to open until they are installed.
71
77
 
72
78
  ## Commands
73
79
 
@@ -17,10 +17,18 @@ import { hasCommand } from "./utils";
17
17
  export default function editorExtension(pi: ExtensionAPI): void {
18
18
  const cwd = process.cwd();
19
19
  const agentModifiedFiles = new Set<string>();
20
+ const requiredDeps = ["bat", "delta", "glow"] as const;
21
+ const getMissingDeps = () => requiredDeps.filter((dep) => !hasCommand(dep));
20
22
 
21
23
  pi.registerCommand("files", {
22
24
  description: "Open file browser",
23
25
  handler: async (_args, ctx) => {
26
+ const missing = getMissingDeps();
27
+ if (missing.length > 0) {
28
+ ctx.ui.notify(`files-widget requires ${missing.join(", ")}. Install: brew install bat git-delta glow`, "error");
29
+ return;
30
+ }
31
+
24
32
  await ctx.ui.custom<void>((tui, theme, _kb, done) => {
25
33
  let pollInterval: ReturnType<typeof setInterval> | null = null;
26
34
 
@@ -122,13 +130,9 @@ export default function editorExtension(pi: ExtensionAPI): void {
122
130
  });
123
131
 
124
132
  pi.on("session_start", async (_event, ctx) => {
125
- const missing: string[] = [];
126
- if (!hasCommand("bat")) missing.push("bat");
127
- if (!hasCommand("delta")) missing.push("delta");
128
- if (!hasCommand("glow")) missing.push("glow");
129
-
133
+ const missing = getMissingDeps();
130
134
  if (missing.length > 0) {
131
- ctx.ui.notify(`Editor: install ${missing.join(", ")} for better experience`, "info");
135
+ ctx.ui.notify(`files-widget requires ${missing.join(", ")}. Install: brew install bat git-delta glow`, "error");
132
136
  }
133
137
 
134
138
  agentModifiedFiles.clear();
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tmustier/pi-files-widget",
3
- "version": "0.1.10",
3
+ "version": "0.1.11",
4
4
  "description": "In-terminal file browser and viewer for Pi.",
5
5
  "license": "MIT",
6
6
  "author": "Thomas Mustier",
@@ -18,6 +18,9 @@
18
18
  "@mariozechner/pi-coding-agent": "^0.50.0",
19
19
  "@mariozechner/pi-tui": "^0.50.0"
20
20
  },
21
+ "scripts": {
22
+ "postinstall": "node -e \"console.log('pi-files-widget: required deps: bat, delta, glow. Install with: brew install bat git-delta glow')\""
23
+ },
21
24
  "pi": {
22
25
  "extensions": [
23
26
  "index.ts"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-extensions",
3
- "version": "0.1.12",
3
+ "version": "0.1.14",
4
4
  "private": false,
5
5
  "keywords": [
6
6
  "pi-package"
@@ -1,31 +0,0 @@
1
- # import-cc-codex implementation loop
2
-
3
- ## Goals
4
- - Implement Phase 1 `pi --import <path>` CLI flow.
5
- - Build Claude Code + Codex transcript parsing + mapping.
6
- - Add usage exclusion + context estimate for imported ranges.
7
- - Preserve metadata, ordering, and labels per spec.
8
- - Prepare for Phase 2 `/import` selector (no UI changes yet unless required).
9
-
10
- ## Checklist (interleaved)
11
- 1. Wire CLI flags + import entrypoint (imp-001)
12
- 2. Implement parsers + mapping utilities (imp-002)
13
- 3. Add import metadata + labeling (imp-004)
14
- 4. Implement usage exclusion + context estimate (imp-003)
15
- 5. Add tool-output redaction (imp-005)
16
- 6. **Reflection**: summarize what works/doesn’t, adjust plan
17
- 7. **Cleanup**: refactor/simplify, remove redundancy, improve clarity
18
- 8. **Testing**: targeted tests for parsers/mapping
19
- 9. Repeat (1–5) as needed
20
- 10. **Reflection** (periodic)
21
- 11. **Cleanup** (periodic)
22
- 12. **Testing**: broaden scope; move toward E2E once CLI flow is stable
23
-
24
- ## Acceptance
25
- - `pi --import <path>` creates a valid Pi session JSONL and opens it.
26
- - Imported sessions are labeled, metadata preserved, and usage excluded.
27
- - Deterministic context % works before first new assistant response.
28
- - Tests cover key parsing and mapping behavior.
29
-
30
- ## Progress Log
31
- - 2026-01-13: Wired `--import`/`--source` CLI flags, added core import module for CC/Codex parsing + mapping, updated README CLI docs, and added startup status banner plumbing. Pending: tests, usage exclusion/context estimate, redaction opt-out.
@@ -1,14 +0,0 @@
1
- {
2
- "name": "import-cc-codex",
3
- "taskFile": ".ralph/import-cc-codex.md",
4
- "iteration": 1,
5
- "maxIterations": 50,
6
- "itemsPerIteration": 3,
7
- "reflectEvery": 3,
8
- "reflectInstructions": "REFLECTION CHECKPOINT\n\nPause and reflect on your progress:\n1. What has been accomplished so far?\n2. What's working well?\n3. What's not working or blocking progress?\n4. Should the approach be adjusted?\n5. What are the next priorities?\n\nUpdate the task file with your reflection, then continue working.",
9
- "active": false,
10
- "status": "completed",
11
- "startedAt": "2026-01-13T13:32:49.696Z",
12
- "lastReflectionAt": 0,
13
- "completedAt": "2026-01-13T13:33:21.479Z"
14
- }
@@ -1,69 +0,0 @@
1
- # Badlogic Game Implementation
2
-
3
- ## Goal
4
- Implement `/badlogic-game` per `badlogic-game/spec.md` with deterministic core logic, reliable tests (unit + integration + E2E), and incremental milestones.
5
-
6
- ## Loop Protocol
7
- - Work on 1 feature per iteration (small, shippable, testable).
8
- - Each iteration MUST:
9
- - Add or extend at least 1 regression test (unit or integration).
10
- - Add or extend at least 1 E2E scripted scenario (headless run with golden frame or state snapshot).
11
- - Record verification evidence (commands + results) in Reflection.
12
- - After each story, do a quick refactor pass to keep code concise and modular.
13
- - Keep diffs small; commit once the feature passes verification.
14
- - Self-reflect every iteration and adjust plan if needed.
15
-
16
- ## Refactor Principles
17
- - Keep files under ~400 LOC; split by responsibility (engine, render, entities, input, levels).
18
- - Prefer pure functions and deterministic state updates; avoid hidden globals.
19
- - Consolidate constants (tiles, glyphs, physics) in one place.
20
- - Eliminate duplication by extracting helpers and data tables.
21
-
22
- ## Typing Strategy
23
- - Use `// @ts-check` + JSDoc types for strict checks without a build step.
24
- - Add `badlogic-game/tsconfig.json` with `checkJs`, `strict`, `noEmit`.
25
- - Typecheck command: `npx tsc --noEmit -p badlogic-game/tsconfig.json` (record results).
26
-
27
- ## Verifiability Standard
28
- - Unit tests: physics tick, jump apex, collision resolution, serialization.
29
- - Integration tests: deterministic input sequences -> expected positions/collisions/state transitions.
30
- - E2E tests: scripted input -> render frames or HUD/state snapshots; compare to golden fixtures.
31
- - Manual checks: milestone smoke test in a live TUI session (M1..M4).
32
-
33
- ## Feature Checklist
34
- - [x] Story 0: Test harness + engine/core separation
35
- - Decide runner (node:test vs custom) and structure
36
- - Deterministic RNG + headless renderer
37
- - [x] Quality: strict typing setup (tsconfig + @ts-check)
38
- - [x] Story 1: Core loop (map, movement, gravity, collision, camera clamp, Level 1)
39
- - [x] Story 2: Enemies + stomp + hazards
40
- - [x] Story 3: Blocks + coins + scoring + HUD
41
- - [x] Story 4: Power-ups (mushroom) + big state
42
- - [x] Story 5: Save/resume + pause/quit
43
- - [x] Story 6: Polish (particles, text cues, camera dead-zone)
44
- - [x] Docs + wiring: `/badlogic-game` command registration and README update
45
- - [ ] Final: full test run + manual E2E checks; update harness logs
46
-
47
- ## Milestone Gates
48
- - [x] M1: Story 1 + test harness + E2E scenario
49
- - [x] M2: Story 2 + tests + E2E scenario
50
- - [x] M3: Story 3/4 + tests + E2E scenario
51
- - [ ] M4: Story 5/6 + tests + manual run
52
-
53
- ## References
54
- - Spec: `badlogic-game/spec.md`
55
- - Existing WIP: `arcade/wip/badlogic-game.ts`
56
-
57
- ## Reflection (Iteration 35)
58
- 1. What has been accomplished so far?
59
- - Added invuln save regression test and paused cue frame E2E fixture.
60
- - Verification: `node --test badlogic-game/tests/*.test.js` -> 77 pass; `npx tsc --noEmit -p badlogic-game/tsconfig.json` -> ok.
61
- 2. What's working well?
62
- - Invuln persistence and paused cue overlay are covered deterministically.
63
- 3. What's not working or blocking progress?
64
- - Manual M4 run still pending (interactive UI required).
65
- 4. Should the approach be adjusted?
66
- - No; keep manual run as final gate.
67
- 5. What are the next priorities?
68
- - M4 manual run.
69
- - Final: update harness logs.
@@ -1,14 +0,0 @@
1
- {
2
- "name": "badlogic-game-impl",
3
- "taskFile": ".ralph/badlogic-game-impl.md",
4
- "iteration": 35,
5
- "maxIterations": 80,
6
- "itemsPerIteration": 1,
7
- "reflectEvery": 1,
8
- "reflectInstructions": "REFLECTION CHECKPOINT\n\nPause and reflect on your progress:\n1. What has been accomplished so far?\n2. What's working well?\n3. What's not working or blocking progress?\n4. Should the approach be adjusted?\n5. What are the next priorities?\n\nUpdate the task file with your reflection, then continue working.",
9
- "active": false,
10
- "status": "completed",
11
- "startedAt": "2026-01-09T03:55:16.633Z",
12
- "lastReflectionAt": 35,
13
- "completedAt": "2026-01-09T09:09:36.947Z"
14
- }
@@ -1,163 +0,0 @@
1
- # Badlogic Game Spec
2
-
3
- ## Goal
4
- Create a comprehensive Mario-style TUI extension spec in `badlogic-game/spec.md` with list-based outline and detailed, verifiable content. Each sub-subsection must include design intent + implementation guidance so it is directly actionable for engineering.
5
-
6
- ## Requirements
7
- - Use list items + subitems for the outline and content.
8
- - Draft section-by-section via ralph loop iterations.
9
- - Iterate at the level of every sub-subsection (e.g., target size, scroll rules).
10
- - After completing each sub-section (e.g., Player Experience & Feel), reflect on coherence and adjust if needed.
11
- - Final coherence reflection at end of doc; adjust as needed.
12
- - Commit after each major section: Core Gameplay, Presentation, Tech + Delivery.
13
-
14
- ## Planned Sections
15
- 1) Core Gameplay
16
- - Player Experience & Feel
17
- - Time-to-fun / quick boot
18
- - Pace / difficulty ramp
19
- - Failure/respawn cadence
20
- - Feel targets vs SMB1
21
- - Controls & Input
22
- - Key mapping
23
- - Input buffering
24
- - Pausing/quitting/restart
25
- - Game Loop & States
26
- - State machine
27
- - Transitions
28
- - Level Design
29
- - Tile palette
30
- - Layout rules
31
- - Level 1 (short)
32
- - Entities & Interactions
33
- - Player
34
- - Blocks
35
- - Items
36
- - Enemies
37
- - Hazards
38
- - Physics & Movement
39
- - Gravity / accel / friction
40
- - Jump (variable)
41
- - Collision resolution
42
-
43
- 2) Presentation
44
- - Camera & Viewport
45
- - Target size
46
- - Scroll rules
47
- - Bounds/edges
48
- - Rendering & Palette
49
- - 256-color plan
50
- - Glyphs / tiles
51
- - HUD & Scoring
52
- - HUD layout
53
- - Score/lives/time/coins
54
- - FX & Feedback (optional)
55
- - Particles
56
- - Text cues
57
-
58
- 3) Tech + Delivery
59
- - Save/Resume
60
- - Autosave cadence
61
- - Persisted fields
62
- - Resume behavior
63
- - Technical Architecture
64
- - Data model
65
- - Update order
66
- - Collision handling
67
- - Input handling
68
- - Serialization
69
- - Feature Stories & Sequencing
70
- - Test Plan
71
- - Milestones
72
- - Open Questions
73
-
74
- ## Checklist
75
- - [x] Create `badlogic-game/spec.md` with list-based scaffold
76
- - [x] Draft Core Gameplay subsections (reflect + adjust after each)
77
- - [x] Player Experience & Feel > Time-to-fun / quick boot
78
- - [x] Player Experience & Feel > Pace / difficulty ramp
79
- - [x] Player Experience & Feel > Failure/respawn cadence
80
- - [x] Player Experience & Feel > Feel targets vs SMB1
81
- - [x] Controls & Input > Key mapping
82
- - [x] Controls & Input > Input buffering
83
- - [x] Controls & Input > Pausing/quitting/restart
84
- - [x] Game Loop & States > State machine
85
- - [x] Game Loop & States > Transitions
86
- - [x] Level Design > Tile palette
87
- - [x] Level Design > Layout rules
88
- - [x] Level Design > Level 1 (short)
89
- - [x] Entities & Interactions > Player
90
- - [x] Entities & Interactions > Blocks
91
- - [x] Entities & Interactions > Items
92
- - [x] Entities & Interactions > Enemies
93
- - [x] Entities & Interactions > Hazards
94
- - [x] Physics & Movement > Gravity / accel / friction
95
- - [x] Physics & Movement > Jump (variable)
96
- - [x] Physics & Movement > Collision resolution
97
- - [x] Commit Core Gameplay section
98
- - [x] Draft Presentation subsections (reflect + adjust after each)
99
- - [x] Camera & Viewport > Target size
100
- - [x] Camera & Viewport > Scroll rules
101
- - [x] Camera & Viewport > Bounds/edges
102
- - [x] Rendering & Palette > 256-color plan
103
- - [x] Rendering & Palette > Glyphs / tiles
104
- - [x] HUD & Scoring > HUD layout
105
- - [x] HUD & Scoring > Score/lives/time/coins
106
- - [x] FX & Feedback > Particles
107
- - [x] FX & Feedback > Text cues
108
- - [x] Commit Presentation section
109
- - [x] Draft Tech + Delivery subsections (reflect + adjust after each)
110
- - [x] Save/Resume > Autosave cadence
111
- - [x] Save/Resume > Persisted fields
112
- - [x] Save/Resume > Resume behavior
113
- - [x] Technical Architecture > Data model
114
- - [x] Technical Architecture > Update order
115
- - [x] Technical Architecture > Collision handling
116
- - [x] Technical Architecture > Input handling
117
- - [x] Technical Architecture > Serialization
118
- - [x] Feature Stories & Sequencing
119
- - [x] Test Plan
120
- - [x] Milestones
121
- - [x] Open Questions
122
- - [x] Commit Tech + Delivery section
123
- - [x] Final coherence reflection; adjust doc as needed
124
-
125
- ## Reflection (Iteration 46)
126
- 1. What has been accomplished so far?
127
- - Completed final coherence pass; clarified player glyph sizing.
128
- 2. What's working well?
129
- - All sections align on sizes, timings, and rendering constraints.
130
- 3. What's not working or blocking progress?
131
- - Nothing blocked.
132
- 4. Should the approach be adjusted?
133
- - No; spec is complete.
134
- 5. What are the next priorities?
135
- - None; ready to stop loop.
136
-
137
- ## Coherence Checks
138
- - Physics & Movement: collision ordering aligns with stomp and head-bump rules.
139
-
140
- ## Tech + Delivery Coherence Check (Iteration 45)
141
- - Save cadence aligns with resume behavior and pause/quit rules.
142
- - Data model fields cover persisted fields list.
143
- - Serialization versioning aligns with SaveState schema.
144
- - Stories/milestones reflect the same delivery order.
145
-
146
- ## Final Coherence Check (Iteration 46)
147
- - Glyph sizing clarified for player big state (1x3 tiles).
148
- - Run modifier, jump buffer, and physics values are consistent.
149
- - Save/resume flow matches input and state machine rules.
150
-
151
- ## Presentation Coherence Check (Iteration 32)
152
- - Viewport size supports HUD lines and 2-char tile grid without wrap.
153
- - Camera rules align with bounds clamp and no vertical scroll assumption.
154
- - Glyphs/tiles use ASCII and 2-char width consistent with rendering plan.
155
- - HUD fields (score/coins/lives/time) match scoring spec values.
156
- - FX cues are lightweight and don't conflict with HUD overlays.
157
-
158
- ## Core Gameplay Coherence Check (Iteration 22)
159
- - Consistency: run modifier defined in Controls; referenced in Physics and feel targets.
160
- - Timing: coyote/jump buffer values consistent between Input and Jump sections.
161
- - Level 1: pacing, layout rules, and hazards align with speed/jump targets.
162
- - Death loop: hazards, enemies, and respawn cadence agree on invuln timing and lives.
163
- - Tile palette: blocks/items/hazards align with symbols; ensure rendering uses same glyphs.
@@ -1,14 +0,0 @@
1
- {
2
- "name": "badlogic-game-spec",
3
- "taskFile": ".ralph/badlogic-game-spec.md",
4
- "iteration": 46,
5
- "maxIterations": 60,
6
- "itemsPerIteration": 1,
7
- "reflectEvery": 1,
8
- "reflectInstructions": "REFLECTION CHECKPOINT\n\nPause and reflect on your progress:\n1. What has been accomplished so far?\n2. What's working well?\n3. What's not working or blocking progress?\n4. Should the approach be adjusted?\n5. What are the next priorities?\n\nUpdate the task file with your reflection, then continue working.",
9
- "active": false,
10
- "status": "completed",
11
- "startedAt": "2026-01-08T22:35:44.127Z",
12
- "lastReflectionAt": 46,
13
- "completedAt": "2026-01-08T23:04:52.947Z"
14
- }
@@ -1,14 +0,0 @@
1
- {
2
- "name": "todo-app-plan",
3
- "taskFile": ".ralph/todo-app-plan.md",
4
- "iteration": 1,
5
- "maxIterations": 50,
6
- "itemsPerIteration": 3,
7
- "reflectEvery": 10,
8
- "reflectInstructions": "REFLECTION CHECKPOINT\n\nPause and reflect on your progress:\n1. What has been accomplished so far?\n2. What's working well?\n3. What's not working or blocking progress?\n4. Should the approach be adjusted?\n5. What are the next priorities?\n\nUpdate the task file with your reflection, then continue working.",
9
- "active": false,
10
- "status": "completed",
11
- "startedAt": "2026-01-26T17:22:57.476Z",
12
- "lastReflectionAt": 0,
13
- "completedAt": "2026-01-26T17:23:25.779Z"
14
- }