opencode-mailbox 0.0.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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 OpenCode Community
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,79 @@
1
+ # opencode-mailbox
2
+
3
+ A simple mailbox system for sending and receiving messages between sessions.
4
+
5
+ ## Description
6
+
7
+ This OpenCode plugin provides a lightweight mailbox system that allows sessions to send messages to each other asynchronously. Messages are stored efficiently, indexed first by recipient and then by timestamp.
8
+
9
+ ## Installation
10
+
11
+ ```bash
12
+ {
13
+ "$schema": "https://opencode.ai/config.json",
14
+ "plugin": [
15
+ "opencode-mailbox"
16
+ ]
17
+ ...
18
+ }
19
+ ```
20
+
21
+ ## Usage
22
+
23
+ The plugin provides three tools:
24
+
25
+ ### Tools
26
+
27
+ - **send_mail** - Send a message to a recipient
28
+ - **watch_unread_mail** - Create a hook that auto-injects messages when received
29
+ - **stop_watching_mail** - Stop all mail watching for the current session
30
+
31
+ ## API
32
+
33
+ ### send_mail
34
+
35
+ Send a message to a recipient.
36
+
37
+ **Parameters:**
38
+ - `to` (string, required) - Recipient name or identifier
39
+ - `from` (string, required) - Sender name or identifier
40
+ - `message` (string, required) - Message content to send
41
+
42
+ ### watch_unread_mail
43
+
44
+ Create a hook that automatically processes unread messages for a recipient.
45
+
46
+ **Parameters:**
47
+ - `name` (string, required) - Name of the recipient to watch
48
+ - `what-to-do-with-it` (string, required) - Instructions on how to process received messages
49
+
50
+ ### stop_watching_mail
51
+
52
+ Stop all mail watching for the current session.
53
+
54
+ **Parameters:**
55
+ - None
56
+
57
+ **Returns:** List of recipients that were being watched and have now been stopped.
58
+
59
+ ## Storage
60
+
61
+ Mail data is persisted in the OpenCode config directory as `mailbox.json`. The storage is optimized with an index structure:
62
+ - First index: recipient (who the mail is to)
63
+ - Second index: timestamp (when the mail was received)
64
+
65
+ ## Session Management
66
+
67
+ When a session ends, all active mail watches for that session are automatically cleaned up.
68
+
69
+ ## Requirements
70
+
71
+ - Peer dependency: `@opencode-ai/plugin` ^1.1.25
72
+
73
+ ## License
74
+
75
+ MIT
76
+
77
+ ## Repository
78
+
79
+ https://github.com/richardanaya/opencode-mailbox
@@ -0,0 +1,3 @@
1
+ import type { Plugin } from "@opencode-ai/plugin";
2
+ declare const mailboxPlugin: Plugin;
3
+ export default mailboxPlugin;