pi-onlyne 0.2.2 → 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.
Files changed (2) hide show
  1. package/README.md +112 -15
  2. package/package.json +14 -6
package/README.md CHANGED
@@ -1,19 +1,70 @@
1
1
  # pi-onlyne
2
2
 
3
- Pi extension for using Onlyne as a workspace-local messaging bridge.
3
+ **Give pi agents a real IM inbox/outbox through [Onlyne](https://github.com/dbydd/onlyne).**
4
4
 
5
- ## What it does
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
- - Watches an existing Onlyne workspace.
8
- - Starts Onlyne for the current workspace when requested.
9
- - Subscribes to inbound channel events without polling.
10
- - Lets the agent reply, send, or broadcast messages through tools.
11
- - Keeps config in the project, not in global home state.
7
+ ## What is Onlyne?
12
8
 
13
- ## Requirements
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.
14
10
 
15
- - `onlyne` available on `PATH`, or set `ONLYNE_BIN`.
16
- - A workspace with `.onlyne/` already initialized.
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.
32
+
33
+ ## Install
34
+
35
+ ```bash
36
+ pi install npm:pi-onlyne
37
+ ```
38
+
39
+ For a one-off run without installing:
40
+
41
+ ```bash
42
+ pi -e npm:pi-onlyne
43
+ ```
44
+
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
+ ```
66
+
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`.
17
68
 
18
69
  ## Commands
19
70
 
@@ -30,13 +81,59 @@ Pi extension for using Onlyne as a workspace-local messaging bridge.
30
81
  onlyne_reply({ text })
31
82
  onlyne_send({ channelId, conversationId, text, rawText? })
32
83
  onlyne_broadcast({ targets, text, rawText? })
33
- onlyne_mark_no_reply({ reason })
84
+ onlyne_mark_no_reply({ reason? })
34
85
  ```
35
86
 
36
- Messages default to Markdown. Set `rawText: true` only when the text must be sent literally.
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
+ })
95
+ ```
96
+
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
+ ```
37
133
 
38
- ## Config
134
+ That keeps each project isolated: different workspaces can run different Onlyne daemons, channels, histories, and policies.
39
135
 
40
- Project-local config lives at `.pi/onlyne.json`. Defaults are safe: watch is manual, inbound messages auto-handle once watch is on, and outbound reply fallback is guarded.
136
+ ## Links
41
137
 
42
- See `SPEC.md` for behavior details.
138
+ - Onlyne main repository: https://github.com/dbydd/onlyne
139
+ - pi-onlyne package: https://www.npmjs.com/package/pi-onlyne
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-onlyne",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "description": "Pi extension tools for sending messages through Onlyne.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -23,8 +23,8 @@
23
23
  "url": "git+https://github.com/dbydd/pi-onlyne.git"
24
24
  },
25
25
  "keywords": [
26
- "pi",
27
26
  "pi-package",
27
+ "pi",
28
28
  "onlyne",
29
29
  "messaging",
30
30
  "extension"
@@ -35,13 +35,21 @@
35
35
  "access": "public",
36
36
  "registry": "https://registry.npmjs.org/"
37
37
  },
38
- "dependencies": {
38
+ "devDependencies": {
39
39
  "@earendil-works/pi-ai": "^0.79.10",
40
40
  "@earendil-works/pi-coding-agent": "^0.79.10",
41
- "typebox": "^1.2.16"
42
- },
43
- "devDependencies": {
41
+ "typebox": "^1.2.16",
44
42
  "@types/node": "^22.15.21",
45
43
  "typescript": "^5.8.3"
44
+ },
45
+ "pi": {
46
+ "extensions": [
47
+ "./dist/index.js"
48
+ ]
49
+ },
50
+ "peerDependencies": {
51
+ "@earendil-works/pi-ai": "*",
52
+ "@earendil-works/pi-coding-agent": "*",
53
+ "typebox": "*"
46
54
  }
47
55
  }