@ogulcancelik/pi-spar 0.1.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 (6) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +58 -0
  3. package/core.ts +879 -0
  4. package/index.ts +760 -0
  5. package/package.json +41 -0
  6. package/peek.ts +683 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Can Celik
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,58 @@
1
+ # pi-spar
2
+
3
+ Agent-to-agent sparring for [pi](https://github.com/badlogic/pi-mono). Back-and-forth conversations with peer AI models for debugging, design review, and challenging your thinking.
4
+
5
+ ## Install
6
+
7
+ ```bash
8
+ pi install npm:@ogulcancelik/pi-spar
9
+ ```
10
+
11
+ ## Setup
12
+
13
+ Configure which models are available for sparring:
14
+
15
+ ```
16
+ /spar-models
17
+ ```
18
+
19
+ This shows all models from your pi configuration and lets you assign short aliases (e.g., `opus`, `gpt`).
20
+
21
+ > **Note:** After changing model aliases, restart pi for the agent to see the updated aliases. The aliases work immediately for tool execution, but the agent's tool description updates on next startup.
22
+
23
+ ## Usage
24
+
25
+ The extension provides a `spar` tool the agent can use, plus commands for viewing sessions.
26
+
27
+ ### Tool: `spar`
28
+
29
+ The agent uses this automatically when you ask it to consult another model:
30
+
31
+ ```
32
+ "spar with gpt5 about whether this architecture makes sense"
33
+ "ask opus to review the error handling in src/auth.ts"
34
+ ```
35
+
36
+ Sessions persist — follow up, push back, disagree. The peer can read files, grep, and explore your codebase but can't execute commands or write files.
37
+
38
+ ### Commands
39
+
40
+ | Command | Description |
41
+ |---------|-------------|
42
+ | `/spar-models` | Configure available sparring models |
43
+ | `/peek [session]` | Watch a spar session in a floating overlay |
44
+ | `/peek-all` | List all sessions, pick one to peek |
45
+
46
+ ### Peek
47
+
48
+ The peek overlay renders the spar conversation using the same components as pi's main TUI — same message styling, same syntax-highlighted tool output, same everything. It's pi inside pi.
49
+
50
+ - **j/k** or **↑/↓** — scroll
51
+ - **g/G** — jump to top/bottom
52
+ - **q** or **Esc** — close
53
+
54
+ Live sessions auto-scroll as the peer model responds.
55
+
56
+ ## License
57
+
58
+ MIT