Skip to content

Commit 0abfa16

Browse files
committed
initial commit for opencode plugin
0 parents  commit 0abfa16

File tree

1,030 files changed

+624896
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,030 files changed

+624896
-0
lines changed

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 Warp
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.

README.md

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# OpenCode + Warp
2+
3+
Official [Warp](https://warp.dev) terminal integration for [OpenCode](https://opencode.ai).
4+
5+
## Features
6+
7+
### 🔔 Native Notifications
8+
9+
Get native Warp notifications when OpenCode:
10+
- **Completes a task** — with a summary showing your prompt and the response
11+
- **Needs your input** — when a permission request is pending
12+
- **Runs a tool** — status updates as tools execute
13+
14+
Notifications appear in Warp's notification center and as system notifications, so you can context-switch while OpenCode works and get alerted when attention is needed.
15+
16+
## Installation
17+
18+
### From npm (recommended)
19+
20+
Add the plugin to your `opencode.json`:
21+
22+
```json
23+
{
24+
"$schema": "https://opencode.ai/config.json",
25+
"plugin": ["opencode-warp"]
26+
}
27+
```
28+
29+
### From local files
30+
31+
Copy or symlink the built plugin into your OpenCode plugins directory:
32+
33+
```bash
34+
# Global
35+
cp dist/index.js ~/.config/opencode/plugins/opencode-warp.js
36+
37+
# Or project-level
38+
cp dist/index.js .opencode/plugins/opencode-warp.js
39+
```
40+
41+
## Requirements
42+
43+
- [Warp terminal](https://warp.dev) (macOS, Linux, or Windows)
44+
- [OpenCode](https://opencode.ai) CLI
45+
46+
## How It Works
47+
48+
This plugin uses Warp's [pluggable notifications](https://docs.warp.dev/features/notifications) feature via OSC escape sequences. When OpenCode triggers an event, the plugin:
49+
50+
1. Reads event data from OpenCode's plugin API
51+
2. Formats a concise notification payload
52+
3. Sends an OSC 777 escape sequence to Warp, which displays a native notification
53+
54+
The plugin hooks into these OpenCode events:
55+
- **session.created** — confirms the plugin is active
56+
- **session.idle** — fires when OpenCode finishes responding, includes your prompt and the response
57+
- **permission.asked** — fires when OpenCode needs tool approval
58+
- **message.updated** — fires when a user prompt is submitted
59+
- **tool.execute.after** — fires when a tool call completes
60+
61+
## Configuration
62+
63+
Notifications work out of the box. To customize Warp's notification behavior (sounds, system notifications, etc.), see [Warp's notification settings](https://docs.warp.dev/features/notifications).
64+
65+
## Development
66+
67+
```bash
68+
# Install dependencies
69+
bun install
70+
71+
# Type check
72+
bun run typecheck
73+
74+
# Run tests
75+
bun test
76+
77+
# Build
78+
bun run build
79+
```
80+
81+
## Uninstall
82+
83+
Remove `"opencode-warp"` from the `plugin` array in your `opencode.json`.
84+
85+
## Contributing
86+
87+
Contributions welcome! Please open an issue or PR on [GitHub](https://github.com/warpdotdev/opencode-warp).
88+
89+
## License
90+
91+
MIT License — see [LICENSE](LICENSE) for details.

dist/index.d.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import type { Plugin } from "@opencode-ai/plugin";
2+
export declare const WarpPlugin: Plugin;
3+
//# sourceMappingURL=index.d.ts.map

dist/index.d.ts.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js

Lines changed: 150 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/notify.d.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/**
2+
* Send a Warp notification via OSC 777 escape sequence.
3+
* Only emits when running inside Warp terminal to avoid garbled output in other terminals.
4+
*/
5+
declare function warpNotify(title: string, body: string): void;
6+
export { warpNotify };
7+
//# sourceMappingURL=notify.d.ts.map

dist/notify.d.ts.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/notify.js

Lines changed: 19 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/notify.js.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)