oppi-mirror 0.4.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.
- package/LICENSE +21 -0
- package/README.md +88 -0
- package/extensions/oppi-mirror.ts +2826 -0
- package/package.json +43 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Da Chen
|
|
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,88 @@
|
|
|
1
|
+
# oppi-mirror
|
|
2
|
+
|
|
3
|
+
`oppi-mirror` is a Pi extension that mirrors an interactive terminal `pi` session into Oppi. The terminal keeps execution ownership; Oppi can watch output, send prompts, steer the active turn, queue follow-ups, answer extension UI, and stop or abort through the bridge.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pi install npm:oppi-mirror
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Use `npm:oppi-mirror@0.4.0` only when you want to pin a specific release; pinned package specs are skipped by `pi update`.
|
|
12
|
+
|
|
13
|
+
For local development from an Oppi checkout:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pi install ./pi-extensions/oppi-mirror
|
|
17
|
+
# or one run only:
|
|
18
|
+
pi -e ./pi-extensions/oppi-mirror
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
If local package loading reports a missing runtime dependency, install package dependencies once:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
cd pi-extensions/oppi-mirror && npm install
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
If Pi is already running, reload extensions:
|
|
28
|
+
|
|
29
|
+
```text
|
|
30
|
+
/reload
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Use
|
|
34
|
+
|
|
35
|
+
Start the Oppi server once so the extension can read `~/.config/oppi/config.json`, then start Pi in an interactive terminal:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
pi
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Check or control the bridge from Pi:
|
|
42
|
+
|
|
43
|
+
```text
|
|
44
|
+
/oppi-mirror status
|
|
45
|
+
/oppi-mirror stop
|
|
46
|
+
/oppi-mirror start
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Configuration
|
|
50
|
+
|
|
51
|
+
By default, the extension reads the local Oppi server URL and token from `~/.config/oppi/config.json`.
|
|
52
|
+
|
|
53
|
+
Override the connection for one process:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
OPPI_MIRROR_URL=http://127.0.0.1:8787 \
|
|
57
|
+
OPPI_MIRROR_TOKEN=your-token \
|
|
58
|
+
pi
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Disable automatic startup in `~/.pi/agent/settings.json`:
|
|
62
|
+
|
|
63
|
+
```json
|
|
64
|
+
{
|
|
65
|
+
"oppiMirror": {
|
|
66
|
+
"autoStart": false
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Or disable it for one process:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
OPPI_MIRROR_AUTO_START=false pi
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Compatibility
|
|
78
|
+
|
|
79
|
+
Mirror supports terminal-owned prompt, steer, follow-up, stop, queue, model, thinking, compaction, tree navigation, command-list, and standard Pi extension UI flows. Session-file replacement remains terminal-owned: use terminal Pi for `/new`, `/fork`, and `/resume`/switch.
|
|
80
|
+
|
|
81
|
+
Mirror forwards Pi-native extension UI from terminal sessions. For example, a `tool_call` handler can ask through `ctx.ui.confirm()` or an `ask` flow, and Oppi renders the response path natively.
|
|
82
|
+
|
|
83
|
+
## Requirements
|
|
84
|
+
|
|
85
|
+
- Oppi server `0.4.0` or newer
|
|
86
|
+
- Interactive terminal `pi`; print, JSON, RPC, and server-owned SDK sessions are not mirror sessions
|
|
87
|
+
|
|
88
|
+
See the full mirror contract and compatibility matrix in the Oppi repo: https://github.com/duh17/oppi/blob/main/docs/oppi-mirror.md
|