pi-extensions 0.1.9
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/.ralph/import-cc-codex.md +31 -0
- package/.ralph/import-cc-codex.state.json +14 -0
- package/.ralph/mario-not-impl.md +69 -0
- package/.ralph/mario-not-impl.state.json +14 -0
- package/.ralph/mario-not-spec.md +163 -0
- package/.ralph/mario-not-spec.state.json +14 -0
- package/LICENSE +21 -0
- package/README.md +65 -0
- package/RELEASING.md +34 -0
- package/agent-guidance/CHANGELOG.md +4 -0
- package/agent-guidance/README.md +102 -0
- package/agent-guidance/agent-guidance.ts +147 -0
- package/agent-guidance/package.json +22 -0
- package/agent-guidance/setup.sh +75 -0
- package/agent-guidance/templates/CLAUDE.md +5 -0
- package/agent-guidance/templates/CODEX.md +92 -0
- package/agent-guidance/templates/GEMINI.md +5 -0
- package/arcade/CHANGELOG.md +4 -0
- package/arcade/README.md +85 -0
- package/arcade/assets/picman.png +0 -0
- package/arcade/assets/ping.png +0 -0
- package/arcade/assets/spice-invaders.png +0 -0
- package/arcade/assets/tetris.png +0 -0
- package/arcade/mario-not/README.md +30 -0
- package/arcade/mario-not/boss.js +103 -0
- package/arcade/mario-not/camera.js +59 -0
- package/arcade/mario-not/collision.js +91 -0
- package/arcade/mario-not/colors.js +36 -0
- package/arcade/mario-not/constants.js +97 -0
- package/arcade/mario-not/core.js +39 -0
- package/arcade/mario-not/death.js +77 -0
- package/arcade/mario-not/effects.js +84 -0
- package/arcade/mario-not/enemies.js +31 -0
- package/arcade/mario-not/engine.js +171 -0
- package/arcade/mario-not/fireballs.js +98 -0
- package/arcade/mario-not/items.js +24 -0
- package/arcade/mario-not/levels.js +403 -0
- package/arcade/mario-not/logic.js +104 -0
- package/arcade/mario-not/mario-not.ts +297 -0
- package/arcade/mario-not/player.js +244 -0
- package/arcade/mario-not/render.js +257 -0
- package/arcade/mario-not/spec.md +548 -0
- package/arcade/mario-not/state.js +246 -0
- package/arcade/mario-not/tests/e2e.test.js +855 -0
- package/arcade/mario-not/tests/engine.test.js +888 -0
- package/arcade/mario-not/tests/fixtures/story0-frame.txt +4 -0
- package/arcade/mario-not/tests/fixtures/story1-camera.txt +4 -0
- package/arcade/mario-not/tests/fixtures/story1-glyphs.txt +4 -0
- package/arcade/mario-not/tests/fixtures/story10-item.txt +4 -0
- package/arcade/mario-not/tests/fixtures/story11-hazards.txt +4 -0
- package/arcade/mario-not/tests/fixtures/story12-used-block.txt +4 -0
- package/arcade/mario-not/tests/fixtures/story13-pipes.txt +4 -0
- package/arcade/mario-not/tests/fixtures/story14-goal.txt +4 -0
- package/arcade/mario-not/tests/fixtures/story15-hud-narrow.txt +2 -0
- package/arcade/mario-not/tests/fixtures/story16-unknown-tile.txt +4 -0
- package/arcade/mario-not/tests/fixtures/story17-mix.txt +4 -0
- package/arcade/mario-not/tests/fixtures/story18-hud-score.txt +2 -0
- package/arcade/mario-not/tests/fixtures/story19-cue.txt +4 -0
- package/arcade/mario-not/tests/fixtures/story2-enemy.txt +4 -0
- package/arcade/mario-not/tests/fixtures/story20-camera-offset.txt +4 -0
- package/arcade/mario-not/tests/fixtures/story21-hud-zero.txt +2 -0
- package/arcade/mario-not/tests/fixtures/story22-big-viewport.txt +4 -0
- package/arcade/mario-not/tests/fixtures/story23-camera-negative.txt +4 -0
- package/arcade/mario-not/tests/fixtures/story24-camera-width.txt +4 -0
- package/arcade/mario-not/tests/fixtures/story25-camera-positive.txt +4 -0
- package/arcade/mario-not/tests/fixtures/story26-hud-lives.txt +2 -0
- package/arcade/mario-not/tests/fixtures/story27-hud-coins.txt +2 -0
- package/arcade/mario-not/tests/fixtures/story28-item-viewport.txt +4 -0
- package/arcade/mario-not/tests/fixtures/story29-enemy-viewport.txt +4 -0
- package/arcade/mario-not/tests/fixtures/story3-hud.txt +2 -0
- package/arcade/mario-not/tests/fixtures/story30-hud-score.txt +2 -0
- package/arcade/mario-not/tests/fixtures/story31-particles-viewport.txt +4 -0
- package/arcade/mario-not/tests/fixtures/story32-paused-frame.txt +4 -0
- package/arcade/mario-not/tests/fixtures/story4-big.txt +4 -0
- package/arcade/mario-not/tests/fixtures/story5-resume-hud.txt +2 -0
- package/arcade/mario-not/tests/fixtures/story6-particles.txt +4 -0
- package/arcade/mario-not/tests/fixtures/story6-paused.txt +4 -0
- package/arcade/mario-not/tests/fixtures/story7-powerup.txt +4 -0
- package/arcade/mario-not/tests/fixtures/story8-hud-time.txt +2 -0
- package/arcade/mario-not/tests/fixtures/story9-hud-level.txt +2 -0
- package/arcade/mario-not/tiles.js +79 -0
- package/arcade/mario-not/tsconfig.json +14 -0
- package/arcade/mario-not/types.js +225 -0
- package/arcade/package.json +26 -0
- package/arcade/picman.ts +328 -0
- package/arcade/ping.ts +594 -0
- package/arcade/spice-invaders.ts +1104 -0
- package/arcade/tetris.ts +662 -0
- package/code-actions/CHANGELOG.md +4 -0
- package/code-actions/README.md +65 -0
- package/code-actions/actions.ts +107 -0
- package/code-actions/index.ts +148 -0
- package/code-actions/package.json +22 -0
- package/code-actions/search.ts +79 -0
- package/code-actions/snippets.ts +179 -0
- package/code-actions/ui.ts +120 -0
- package/files-widget/CHANGELOG.md +90 -0
- package/files-widget/DESIGN.md +452 -0
- package/files-widget/README.md +122 -0
- package/files-widget/TODO.md +141 -0
- package/files-widget/browser.ts +922 -0
- package/files-widget/comment.ts +5 -0
- package/files-widget/constants.ts +18 -0
- package/files-widget/demo.svg +1 -0
- package/files-widget/file-tree.ts +224 -0
- package/files-widget/file-viewer.ts +93 -0
- package/files-widget/git.ts +107 -0
- package/files-widget/index.ts +140 -0
- package/files-widget/input-utils.ts +3 -0
- package/files-widget/package.json +22 -0
- package/files-widget/types.ts +28 -0
- package/files-widget/utils.ts +26 -0
- package/files-widget/viewer.ts +424 -0
- package/import-cc-codex/research/import-chats-from-other-agents.md +135 -0
- package/import-cc-codex/spec.md +79 -0
- package/package.json +29 -0
- package/ralph-wiggum/CHANGELOG.md +7 -0
- package/ralph-wiggum/README.md +96 -0
- package/ralph-wiggum/SKILL.md +73 -0
- package/ralph-wiggum/index.ts +792 -0
- package/ralph-wiggum/package.json +25 -0
- package/raw-paste/CHANGELOG.md +7 -0
- package/raw-paste/README.md +52 -0
- package/raw-paste/index.ts +112 -0
- package/raw-paste/package.json +22 -0
- package/tab-status/CHANGELOG.md +4 -0
- package/tab-status/README.md +61 -0
- package/tab-status/assets/tab-status.png +0 -0
- package/tab-status/package.json +22 -0
- package/tab-status/tab-status.ts +179 -0
- package/usage-extension/CHANGELOG.md +17 -0
- package/usage-extension/README.md +120 -0
- package/usage-extension/index.ts +628 -0
- package/usage-extension/package.json +22 -0
- package/usage-extension/screenshot.png +0 -0
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
# files-widget
|
|
2
|
+
|
|
3
|
+
In-terminal file browser and viewer for Pi. Navigate files, view diffs, select code, and send comments to the agent without leaving the terminal.
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
**Quick install (Pi package manager):**
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
pi install npm:@tmustier/pi-files-widget
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pi install git:github.com/tmustier/pi-extensions
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Then add to `~/.pi/agent/settings.json`:
|
|
20
|
+
|
|
21
|
+
```json
|
|
22
|
+
{
|
|
23
|
+
"packages": [
|
|
24
|
+
{
|
|
25
|
+
"source": "git:github.com/tmustier/pi-extensions",
|
|
26
|
+
"extensions": ["files-widget/index.ts"]
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
**Local clone:**
|
|
33
|
+
|
|
34
|
+
Add to your Pi extensions list:
|
|
35
|
+
|
|
36
|
+
```json
|
|
37
|
+
{
|
|
38
|
+
"extensions": [
|
|
39
|
+
"~/pi-extensions/files-widget"
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
If you prefer symlinking into `~/.pi/agent/extensions`:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
ln -sfn ~/pi-extensions/files-widget ~/.pi/agent/extensions/files-widget
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Then reference it in your settings:
|
|
51
|
+
|
|
52
|
+
```json
|
|
53
|
+
{
|
|
54
|
+
"extensions": [
|
|
55
|
+
"~/.pi/agent/extensions/files-widget"
|
|
56
|
+
]
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Dependencies (recommended)
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
brew install bat git-delta glow
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
- `bat`: syntax highlighting
|
|
67
|
+
- `delta`: formatted diffs
|
|
68
|
+
- `glow`: markdown rendering
|
|
69
|
+
|
|
70
|
+
If any are missing, the extension will notify you at session start and gracefully fall back to plain rendering.
|
|
71
|
+
|
|
72
|
+
## Commands
|
|
73
|
+
|
|
74
|
+
- `/files` - open the file browser
|
|
75
|
+
- `/review` - open tuicr review flow
|
|
76
|
+
- `/diff` - open critique (bunx critique)
|
|
77
|
+
|
|
78
|
+
### Review/Diff Dependencies
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
brew install agavra/tap/tuicr
|
|
82
|
+
brew install oven-sh/bun/bun
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
- `tuicr` is required for `/review`
|
|
86
|
+
- `bun` is required for `/diff`
|
|
87
|
+
|
|
88
|
+
If missing, `/review` or `/diff` will show a clear install prompt.
|
|
89
|
+
|
|
90
|
+
## Browser Keybindings
|
|
91
|
+
|
|
92
|
+
- `j/k` or `↑/↓`: move
|
|
93
|
+
- `Enter`: open file / expand folder
|
|
94
|
+
- `h/l` or `←/→`: collapse/expand folder
|
|
95
|
+
- `PgUp/PgDn`: page up/down
|
|
96
|
+
- `c`: toggle changed-only view
|
|
97
|
+
- `]` / `[`: next/prev changed file
|
|
98
|
+
- `/`: search (type to filter, `Esc` to exit)
|
|
99
|
+
- `+` / `-`: increase/decrease browser height
|
|
100
|
+
- `q`: close
|
|
101
|
+
|
|
102
|
+
## Viewer Keybindings
|
|
103
|
+
|
|
104
|
+
- `j/k` or `↑/↓`: scroll
|
|
105
|
+
- `PgUp/PgDn`: page up/down
|
|
106
|
+
- `g/G`: top/bottom
|
|
107
|
+
- `d`: toggle diff (tracked files only)
|
|
108
|
+
- `/`: search (type to search)
|
|
109
|
+
- `n` / `N`: next/prev match
|
|
110
|
+
- `v`: select mode (line selection)
|
|
111
|
+
- `c`: comment on selected lines (inline prompt)
|
|
112
|
+
- `]` / `[`: next/prev changed file
|
|
113
|
+
- `+` / `-`: increase/decrease viewer height
|
|
114
|
+
- `q`: back to browser
|
|
115
|
+
|
|
116
|
+
## Notes
|
|
117
|
+
|
|
118
|
+
- Untracked files show as `[UNTRACKED]` and open in normal view.
|
|
119
|
+
- Folder LOCs are shown only when the folder is collapsed (expanded folders would duplicate counts).
|
|
120
|
+
- Line counts load asynchronously; the header shows activity while counts are computed.
|
|
121
|
+
- Large non-git folders load progressively and may show `[partial]` while loading in safe mode.
|
|
122
|
+
- Git status refreshes every 3 seconds while `/files` is open.
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
# Editor Extension - Implementation Checklist
|
|
2
|
+
|
|
3
|
+
## Pre-requisites
|
|
4
|
+
- [x] Check for required tools (`bat`, `delta`, `glow`, `fd`) and document install commands
|
|
5
|
+
- [ ] Verify pi-tui capabilities for widget sizing and keyboard handling
|
|
6
|
+
|
|
7
|
+
## Phase 1: File Browser Widget
|
|
8
|
+
|
|
9
|
+
### Scaffold
|
|
10
|
+
- [x] Create `index.ts` extension entry point
|
|
11
|
+
- [ ] Register `Ctrl+E` toggle shortcut
|
|
12
|
+
- [x] Basic widget rendering with placeholder content
|
|
13
|
+
|
|
14
|
+
### File Tree
|
|
15
|
+
- [x] Build file tree from current directory
|
|
16
|
+
- [ ] Respect `.gitignore` (use `fd` or manual parsing)
|
|
17
|
+
- [x] Collapse/expand directories
|
|
18
|
+
- [x] Navigation with `j/k` and arrow keys
|
|
19
|
+
- [x] Enter to expand dir or open file
|
|
20
|
+
|
|
21
|
+
### Git Integration
|
|
22
|
+
- [x] Parse `git status --porcelain` output
|
|
23
|
+
- [x] Show indicators: M (modified), ? (untracked), A (added), D (deleted)
|
|
24
|
+
- [x] Color coding: green (staged), yellow (unstaged), grey (untracked)
|
|
25
|
+
|
|
26
|
+
### Search
|
|
27
|
+
- [x] `/` to enter search mode
|
|
28
|
+
- [ ] Fuzzy match file names
|
|
29
|
+
- [ ] Highlight matches, Enter to jump
|
|
30
|
+
|
|
31
|
+
## Phase 2: File Viewer
|
|
32
|
+
|
|
33
|
+
### Basic Viewer
|
|
34
|
+
- [x] `ctx.ui.custom()` full-screen component
|
|
35
|
+
- [x] Load file content
|
|
36
|
+
- [x] Line numbers
|
|
37
|
+
- [x] Scroll with `j/k`, `PgUp/PgDn`, `g/G`
|
|
38
|
+
- [x] `q` to close
|
|
39
|
+
|
|
40
|
+
### Syntax Highlighting
|
|
41
|
+
- [x] Detect `bat` availability
|
|
42
|
+
- [x] Shell out to `bat` for highlighting
|
|
43
|
+
- [x] Parse ANSI output for display
|
|
44
|
+
- [x] Fallback to plain text with line numbers
|
|
45
|
+
|
|
46
|
+
### Markdown Rendering
|
|
47
|
+
- [x] Detect `glow` availability
|
|
48
|
+
- [x] Shell out to `glow` for .md files
|
|
49
|
+
- [ ] Toggle between rendered and raw (`m` key?)
|
|
50
|
+
- [x] Fallback to syntax-highlighted raw
|
|
51
|
+
|
|
52
|
+
### Diff View
|
|
53
|
+
- [x] `d` to toggle diff mode
|
|
54
|
+
- [x] Shell out to `git diff HEAD -- <file>`
|
|
55
|
+
- [x] Use `delta` if available for nicer output
|
|
56
|
+
- [x] Show only if file has changes
|
|
57
|
+
|
|
58
|
+
## Phase 3: Select + Comment + Send
|
|
59
|
+
|
|
60
|
+
### Selection Mode
|
|
61
|
+
- [x] `v` to enter selection mode
|
|
62
|
+
- [x] Track start line and current line
|
|
63
|
+
- [x] Visual highlight of selected range
|
|
64
|
+
- [x] `j/k` to extend selection
|
|
65
|
+
- [x] `Esc` to cancel
|
|
66
|
+
|
|
67
|
+
### Comment Dialog
|
|
68
|
+
- [x] `c` to open comment input
|
|
69
|
+
- [ ] Multi-line text input
|
|
70
|
+
- [x] `Enter` or `Ctrl+Enter` to confirm
|
|
71
|
+
- [x] `Esc` to cancel
|
|
72
|
+
|
|
73
|
+
### Send to Agent
|
|
74
|
+
- [x] Format message with file path, line range, code snippet, comment
|
|
75
|
+
- [x] Use `pi.sendUserMessage()` with `deliverAs: "followUp"`
|
|
76
|
+
- [x] Handle case when agent is idle vs streaming
|
|
77
|
+
- [ ] Show confirmation notification
|
|
78
|
+
|
|
79
|
+
## Phase 4: tuicr Integration (Optional)
|
|
80
|
+
|
|
81
|
+
### Setup
|
|
82
|
+
- [x] Check for tuicr availability (`which tuicr`)
|
|
83
|
+
- [x] Document install: `brew install agavra/tap/tuicr`
|
|
84
|
+
|
|
85
|
+
### /review Command
|
|
86
|
+
- [x] Register `/review` command
|
|
87
|
+
- [x] Spawn tuicr with `stdio: "inherit"` (takes over terminal)
|
|
88
|
+
- [x] After exit, read clipboard (`pbpaste` on macOS, `xclip` on Linux)
|
|
89
|
+
- [x] Detect tuicr export format (contains `## Review Summary` or structured markdown)
|
|
90
|
+
- [x] Send review to agent via `pi.sendUserMessage()`
|
|
91
|
+
- [x] Show confirmation notification
|
|
92
|
+
|
|
93
|
+
### UX
|
|
94
|
+
- [ ] `/review` - review all unstaged changes
|
|
95
|
+
- [ ] `/review --staged` - review staged changes
|
|
96
|
+
- [ ] `/review HEAD` - review last commit
|
|
97
|
+
|
|
98
|
+
## Phase 5: critique Integration (Optional)
|
|
99
|
+
|
|
100
|
+
### Setup
|
|
101
|
+
- [ ] Check for critique availability (requires Bun)
|
|
102
|
+
- [ ] Document install: `bun install -g critique`
|
|
103
|
+
|
|
104
|
+
### /diff Command
|
|
105
|
+
- [x] Register `/diff` command
|
|
106
|
+
- [x] Spawn critique for quick diff viewing
|
|
107
|
+
- [ ] `/diff --watch` for live monitoring while agent works
|
|
108
|
+
- [x] `/diff <file>` for specific file
|
|
109
|
+
|
|
110
|
+
### Web Preview
|
|
111
|
+
- [ ] `/diff --web` generates shareable URL
|
|
112
|
+
- [ ] Useful for async review or sharing with others
|
|
113
|
+
|
|
114
|
+
## Phase 6: Agent Awareness
|
|
115
|
+
|
|
116
|
+
### Track Modifications
|
|
117
|
+
- [x] Subscribe to `tool_result` events
|
|
118
|
+
- [x] Filter for `write` and `edit` tools
|
|
119
|
+
- [x] Extract file paths from tool inputs
|
|
120
|
+
- [ ] Store in extension state with timestamps
|
|
121
|
+
|
|
122
|
+
### Visual Indicators
|
|
123
|
+
- [x] Badge files in tree with "agent modified" icon (e.g., 🤖)
|
|
124
|
+
- [ ] Different indicator for "agent modified this session" vs "human modified"
|
|
125
|
+
- [ ] Persist across session reload via `pi.appendEntry()`
|
|
126
|
+
|
|
127
|
+
### Per-Line Attribution (Stretch - Cursor Blame style)
|
|
128
|
+
- [ ] Parse edit tool diffs to get line ranges
|
|
129
|
+
- [ ] Store line-level attribution metadata (which model, which tool call)
|
|
130
|
+
- [ ] Show in file viewer gutter
|
|
131
|
+
- [ ] Differentiate: Tab completions vs agent runs vs human edits
|
|
132
|
+
|
|
133
|
+
## Polish
|
|
134
|
+
|
|
135
|
+
- [x] Error handling for missing tools
|
|
136
|
+
- [x] Graceful degradation (no git, no bat, etc.)
|
|
137
|
+
- [ ] Performance: cache file tree, lazy load
|
|
138
|
+
- [ ] Help overlay (`?` key)
|
|
139
|
+
- [ ] Configurable keybindings
|
|
140
|
+
- [x] Theme integration (use pi theme colors)
|
|
141
|
+
- [x] Linux clipboard support (`xclip -selection clipboard`)
|