@amaster.ai/pi-channels 0.1.9 → 0.1.10

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 +13 -39
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -4,24 +4,13 @@
4
4
 
5
5
  Pi extension for native messaging channels.
6
6
 
7
- This package follows the same extension shape as the open-source `@e9n/pi-channels`
8
- package: it registers a `notify` tool, channel events, route aliases, and an optional
9
- chat bridge that turns incoming channel messages into pi prompts.
7
+ This package follows the same extension shape as the open-source `@e9n/pi-channels` package: it registers a `notify` tool, channel events, route aliases, and an optional chat bridge that turns incoming channel messages into pi prompts.
10
8
 
11
- It does not depend on `@e9n/pi-channels` at runtime. That package is published as
12
- a standalone extension source package with the older `@mariozechner/*` peer
13
- namespace and Slack/Telegram dependencies. This package keeps the same channel
14
- contract while targeting this repo's `@earendil-works/*` API surface and native
15
- Feishu/DingTalk/WeCom adapters.
9
+ It does not depend on `@e9n/pi-channels` at runtime. That package is published as a standalone extension source package with the older `@mariozechner/*` peer namespace and Slack/Telegram dependencies. This package keeps the same channel contract while targeting this repo's `@earendil-works/*` API surface and native Feishu/DingTalk/WeCom adapters.
16
10
 
17
11
  ## Configuration
18
12
 
19
- Put the `pi-channels` section in `~/.pi/agent/settings.json`, the configured
20
- agent directory's `settings.json`, or a project/ancestor `.pi/settings.json`.
21
- Project-local files are read only after project trust is accepted. `${ENV_VAR}`
22
- interpolation is supported only in user and agent settings, not in project-local
23
- files. The direct credential environment variables documented in the examples
24
- still override loaded adapter values.
13
+ Put the `pi-channels` section in `~/.pi/agent/settings.json`, the configured agent directory's `settings.json`, or a project/ancestor `.pi/settings.json`. Project-local files are read only after project trust is accepted. `${ENV_VAR}` interpolation is supported only in user and agent settings, not in project-local files. The direct credential environment variables documented in the examples still override loaded adapter values.
25
14
 
26
15
  ## Channels
27
16
 
@@ -39,9 +28,7 @@ still override loaded adapter values.
39
28
 
40
29
  ## Example
41
30
 
42
- The `${...}` placeholders below assume this section is stored in user or agent
43
- settings. For trusted project settings, use the corresponding direct credential
44
- environment variables or literal non-secret values.
31
+ The `${...}` placeholders below assume this section is stored in user or agent settings. For trusted project settings, use the corresponding direct credential environment variables or literal non-secret values.
45
32
 
46
33
  ```json
47
34
  {
@@ -85,8 +72,7 @@ environment variables or literal non-secret values.
85
72
 
86
73
  ### Feishu modes
87
74
 
88
- WebSocket is the default and recommended mode because it does not require a
89
- public callback URL:
75
+ WebSocket is the default and recommended mode because it does not require a public callback URL:
90
76
 
91
77
  ```json
92
78
  {
@@ -99,10 +85,7 @@ public callback URL:
99
85
  }
100
86
  ```
101
87
 
102
- Use HTTP callback mode when the deployment already exposes a Feishu event URL.
103
- The SDK handles challenge responses, token verification, and encrypted event
104
- payloads. `encryptKey` is required in HTTP mode because it is used to verify
105
- ordinary event signatures; `verificationToken` alone is not sufficient:
88
+ Use HTTP callback mode when the deployment already exposes a Feishu event URL. The SDK handles challenge responses, token verification, and encrypted event payloads. `encryptKey` is required in HTTP mode because it is used to verify ordinary event signatures; `verificationToken` alone is not sufficient:
106
89
 
107
90
  ```json
108
91
  {
@@ -124,8 +107,7 @@ Set `"eventMode": "off"` for outgoing-only usage.
124
107
 
125
108
  ### DingTalk modes
126
109
 
127
- Create a DingTalk internal app, add the bot capability, select Stream mode, and
128
- publish it. Copy the Client ID and Client Secret into the adapter config:
110
+ Create a DingTalk internal app, add the bot capability, select Stream mode, and publish it. Copy the Client ID and Client Secret into the adapter config:
129
111
 
130
112
  ```json
131
113
  {
@@ -139,16 +121,13 @@ publish it. Copy the Client ID and Client Secret into the adapter config:
139
121
  }
140
122
  ```
141
123
 
142
- Incoming replies use the per-message `sessionWebhook` when available. Active
143
- route sends use DingTalk's group message OpenAPI with the route recipient as the
144
- conversation/openConversationId. `robotCode` defaults to `clientId` when omitted.
124
+ Incoming replies use the per-message `sessionWebhook` when available. Active route sends use DingTalk's group message OpenAPI with the route recipient as the conversation/openConversationId. `robotCode` defaults to `clientId` when omitted.
145
125
 
146
126
  Set `"eventMode": "off"` when the bot should only send messages.
147
127
 
148
128
  ### WeCom modes
149
129
 
150
- Create an intelligent bot in the WeCom admin console, choose API mode, and select
151
- the long connection option. Copy the Bot ID and Secret into the adapter config:
130
+ Create an intelligent bot in the WeCom admin console, choose API mode, and select the long connection option. Copy the Bot ID and Secret into the adapter config:
152
131
 
153
132
  ```json
154
133
  {
@@ -170,8 +149,7 @@ notify(action: "list")
170
149
  notify(action: "test", adapter: "ops")
171
150
  ```
172
151
 
173
- For Feishu, recipients default to `chat_id`. Prefix the recipient to override the
174
- receive id type:
152
+ For Feishu, recipients default to `chat_id`. Prefix the recipient to override the receive id type:
175
153
 
176
154
  ```text
177
155
  chat_id:oc_xxx
@@ -180,20 +158,16 @@ user_id:abc123
180
158
  email:name@example.com
181
159
  ```
182
160
 
183
- For WeCom intelligent bots, recipients are the conversation ids used by the Bot
184
- API. In a group, send one message to the bot and use route capture to fill the
185
- group `chatid`; for one-to-one pushes, use the target user's userid:
161
+ For WeCom intelligent bots, recipients are the conversation ids used by the Bot API. In a group, send one message to the bot and use route capture to fill the group `chatid`; for one-to-one pushes, use the target user's userid:
186
162
 
187
163
  ```text
188
164
  wr_xxx
189
165
  zhangsan
190
166
  ```
191
167
 
192
- The intelligent bot adapter uses the WebSocket Bot API, so long connection mode
193
- does not require a public callback URL.
168
+ The intelligent bot adapter uses the WebSocket Bot API, so long connection mode does not require a public callback URL.
194
169
 
195
- For DingTalk app bots, send one message to the bot and use route capture to fill
196
- the group conversation id:
170
+ For DingTalk app bots, send one message to the bot and use route capture to fill the group conversation id:
197
171
 
198
172
  ```text
199
173
  cid_xxx
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amaster.ai/pi-channels",
3
- "version": "0.1.9",
3
+ "version": "0.1.10",
4
4
  "description": "Pi extension for native messaging channels including Feishu, DingTalk, WeCom, and webhooks.",
5
5
  "keywords": [
6
6
  "pi-package",
@@ -58,7 +58,7 @@
58
58
  "@larksuiteoapi/node-sdk": "^1.64.0",
59
59
  "@wecom/aibot-node-sdk": "^1.0.7",
60
60
  "dingtalk-stream": "^2.1.6-beta.1",
61
- "@amaster.ai/pi-shared": "0.1.9"
61
+ "@amaster.ai/pi-shared": "0.1.10"
62
62
  },
63
63
  "scripts": {
64
64
  "build": "tsc -b",