pi-onlyne 0.2.3 → 0.2.4
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/README.md +101 -16
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,14 +1,34 @@
|
|
|
1
1
|
# pi-onlyne
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**Give pi agents a real IM inbox/outbox through [Onlyne](https://github.com/dbydd/onlyne).**
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
`pi-onlyne` is the Pi extension for Onlyne. It adds tools and commands to pi so an agent can receive messages from IM channels and send replies without pretending that a chat platform is a terminal, a browser tab, or a custom workflow engine.
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
## What is Onlyne?
|
|
8
|
+
|
|
9
|
+
[Onlyne](https://github.com/dbydd/onlyne) is a small workspace-local IM channel daemon. It runs in your project directory, keeps its config/state under `.onlyne/`, and brokers local agent calls to real messaging adapters such as Telegram, Feishu/Lark, QQ Bot, and WeChat.
|
|
10
|
+
|
|
11
|
+
Onlyne is deliberately narrow:
|
|
12
|
+
|
|
13
|
+
- local workspace daemon, not a global cloud service
|
|
14
|
+
- channel broker, not an agent runtime
|
|
15
|
+
- Unix socket / stdio friendly, not a web dashboard
|
|
16
|
+
- local history and event stream, not a heavy message platform
|
|
17
|
+
|
|
18
|
+
## What does this extension do?
|
|
19
|
+
|
|
20
|
+
`pi-onlyne` connects pi to an existing Onlyne workspace and exposes Onlyne as native pi tools.
|
|
21
|
+
|
|
22
|
+
With this extension, a pi agent can:
|
|
23
|
+
|
|
24
|
+
- watch an Onlyne workspace for inbound IM messages
|
|
25
|
+
- surface inbound messages into the current pi session
|
|
26
|
+
- reply to the current inbound message
|
|
27
|
+
- send a message to a specific channel conversation
|
|
28
|
+
- broadcast the same message to multiple conversations
|
|
29
|
+
- mark an inbound message as intentionally not replied
|
|
30
|
+
|
|
31
|
+
Messages are Markdown by default, matching normal agent output. Use `rawText: true` only when the message must be sent literally.
|
|
12
32
|
|
|
13
33
|
## Install
|
|
14
34
|
|
|
@@ -16,16 +36,35 @@ Pi extension for using Onlyne as a workspace-local messaging bridge.
|
|
|
16
36
|
pi install npm:pi-onlyne
|
|
17
37
|
```
|
|
18
38
|
|
|
19
|
-
For a one-off run:
|
|
39
|
+
For a one-off run without installing:
|
|
20
40
|
|
|
21
41
|
```bash
|
|
22
42
|
pi -e npm:pi-onlyne
|
|
23
43
|
```
|
|
24
44
|
|
|
25
|
-
|
|
45
|
+
You also need the `onlyne` CLI installed and an initialized workspace:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
onlyne init
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
If `onlyne` is not on `PATH`, set:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
export ONLYNE_BIN=/path/to/onlyne
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Typical workflow
|
|
58
|
+
|
|
59
|
+
1. Initialize/configure Onlyne in your project.
|
|
60
|
+
2. Install this Pi extension.
|
|
61
|
+
3. Start watching from pi:
|
|
62
|
+
|
|
63
|
+
```text
|
|
64
|
+
/onlyne watch on
|
|
65
|
+
```
|
|
26
66
|
|
|
27
|
-
-
|
|
28
|
-
- A workspace with `.onlyne/` already initialized.
|
|
67
|
+
When a message arrives through Onlyne, pi receives it as a follow-up message. The agent can then call `onlyne_reply`, or deliberately call `onlyne_mark_no_reply`.
|
|
29
68
|
|
|
30
69
|
## Commands
|
|
31
70
|
|
|
@@ -42,13 +81,59 @@ pi -e npm:pi-onlyne
|
|
|
42
81
|
onlyne_reply({ text })
|
|
43
82
|
onlyne_send({ channelId, conversationId, text, rawText? })
|
|
44
83
|
onlyne_broadcast({ targets, text, rawText? })
|
|
45
|
-
onlyne_mark_no_reply({ reason })
|
|
84
|
+
onlyne_mark_no_reply({ reason? })
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Send one message
|
|
88
|
+
|
|
89
|
+
```ts
|
|
90
|
+
onlyne_send({
|
|
91
|
+
channelId: "telegram",
|
|
92
|
+
conversationId: "123456",
|
|
93
|
+
text: "# Build report\n\nAll checks passed."
|
|
94
|
+
})
|
|
46
95
|
```
|
|
47
96
|
|
|
48
|
-
|
|
97
|
+
### Send literal text
|
|
98
|
+
|
|
99
|
+
```ts
|
|
100
|
+
onlyne_send({
|
|
101
|
+
channelId: "telegram",
|
|
102
|
+
conversationId: "123456",
|
|
103
|
+
text: "# not a heading",
|
|
104
|
+
rawText: true
|
|
105
|
+
})
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### Broadcast
|
|
109
|
+
|
|
110
|
+
```ts
|
|
111
|
+
onlyne_broadcast({
|
|
112
|
+
targets: [
|
|
113
|
+
{ channelId: "telegram", conversationId: "123456" },
|
|
114
|
+
{ channelId: "feishu", conversationId: "oc_xxx" }
|
|
115
|
+
],
|
|
116
|
+
text: "# Release shipped\n\nVersion 0.2.3 is live."
|
|
117
|
+
})
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
## Local state
|
|
121
|
+
|
|
122
|
+
This extension stores its own pi-side config at:
|
|
123
|
+
|
|
124
|
+
```text
|
|
125
|
+
.pi/onlyne.json
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Onlyne itself stores workspace state under:
|
|
129
|
+
|
|
130
|
+
```text
|
|
131
|
+
.onlyne/
|
|
132
|
+
```
|
|
49
133
|
|
|
50
|
-
|
|
134
|
+
That keeps each project isolated: different workspaces can run different Onlyne daemons, channels, histories, and policies.
|
|
51
135
|
|
|
52
|
-
|
|
136
|
+
## Links
|
|
53
137
|
|
|
54
|
-
|
|
138
|
+
- Onlyne main repository: https://github.com/dbydd/onlyne
|
|
139
|
+
- pi-onlyne package: https://www.npmjs.com/package/pi-onlyne
|