@long_88/openclaw-aicc-channel-cli 0.1.2 → 0.1.3

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 (3) hide show
  1. package/README.md +1 -1
  2. package/cli.mjs +12 -3
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -9,7 +9,7 @@ npx -y @long_88/openclaw-aicc-channel-cli install
9
9
  ```
10
10
 
11
11
  When the install completes, the CLI also inspects `~/.openclaw/openclaw-weixin/accounts.json`.
12
- If exactly one Weixin account is available, it prints that `weixinFanoutAccountId` and the matching `weixinFanoutTo` from `~/.openclaw/openclaw-weixin/accounts/<id>.json`, then waits for you to press Enter before the process exits. If multiple accounts are detected, the CLI exits with an error so you can resolve the ambiguity first.
12
+ If exactly one Weixin account is available, it prints a single `weixinFanoutBundle` value derived from `~/.openclaw/openclaw-weixin/accounts/<id>.json`, then waits for you to press Enter before the process exits. The bundle is a base64url-encoded JSON envelope with the shape `{"v":1,"accountId":"...","to":"..."}`. If multiple accounts are detected, the CLI exits with an error so you can resolve the ambiguity first.
13
13
 
14
14
  Configure a bridge account while installing:
15
15
 
package/cli.mjs CHANGED
@@ -193,6 +193,17 @@ function readJsonFile(filePath) {
193
193
  return JSON.parse(readFileSync(filePath, "utf8"));
194
194
  }
195
195
 
196
+ function encodeWeixinFanoutBundle(accountId, to) {
197
+ return Buffer.from(
198
+ JSON.stringify({
199
+ v: 1,
200
+ accountId,
201
+ to
202
+ }),
203
+ "utf8"
204
+ ).toString("base64url");
205
+ }
206
+
196
207
  async function waitForEnter() {
197
208
  const rl = createInterface({
198
209
  input: process.stdin,
@@ -238,8 +249,6 @@ async function logWeixinAccounts() {
238
249
  const accountId = accountIds[0];
239
250
  const accountPath = join(weixinDir, "accounts", `${accountId}.json`);
240
251
 
241
- log(`weixinFanoutAccountId=${accountId}`);
242
-
243
252
  if (!existsSync(accountPath)) {
244
253
  log(`account config file was not found: ${accountPath}`);
245
254
  return;
@@ -249,7 +258,7 @@ async function logWeixinAccounts() {
249
258
  const accountConfig = readJsonFile(accountPath);
250
259
 
251
260
  if (accountConfig?.userId) {
252
- log(`weixinFanoutTo=${accountConfig.userId}`);
261
+ log(`weixinFanoutBundle=${encodeWeixinFanoutBundle(accountId, accountConfig.userId)}`);
253
262
  }
254
263
  } catch (error) {
255
264
  log(`failed to read account config ${accountPath}: ${error.message}`);
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@long_88/openclaw-aicc-channel-cli",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "CLI installer for the OpenClaw AICC channel plugin.",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "bin": {
8
- "aicc-channel-installer": "./cli.mjs"
8
+ "aicc-channel-installer": "cli.mjs"
9
9
  },
10
10
  "files": [
11
11
  "cli.mjs",