ECCP
exine

layer3/client.ts

面向建構者的客戶端,讓鋒利邊界保持可見。

exine 是一個帶有程式碼形狀的 ECCP 客戶端。它保留鍵盤優先工作流、結構化輸出與 plugin hooks,讓開發者與營運者能組合自己的介面,而不是重寫整個協議。

exine / host shell

$ exine login --homeserver https://node.eccp.dev

$ exine rooms watch --tag incident-response --format ndjson

$ exine plugins enable bot-host --capability rooms:write

$ exine sync tail --since state://shadow-room/main

CLI 優先

從同一個客戶端表面把房間事件導入腳本、追蹤同步狀態,並自動化營運工作流。

Plugin 宿主

擴充套件可以訂閱事件、加入命令並承載 automation,而不必 fork 整個應用。

可組合輸出

結構化結果讓 exine 能直接用在 CI、治理儀表板與自訂 bot 營運表面。

Plugin API

以純 TypeScript 實作 bot host 能力。

Plugin 可以註冊命令、檢查聯邦對等節點,並在客戶端內承載 automation,而且所有能力都依賴明確授權,而不是隱藏側通道。

plugins/ops-bot-host.ts

TypeScript

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import { definePlugin } from "@eccp/exine-sdk";

export default definePlugin({
  name: "ops-bot-host",
  capabilities: ["rooms:read", "rooms:write", "bot:host"],
  async activate(host) {
    host.on("message.received", async (event) => {
      if (!event.room.tags.includes("ops")) return;

      await host.bot.reply(event.roomId, {
        body: \`ack \${event.eventId}\`,
        shadow: true
      });
    });

    await host.commands.register("peers", async () => {
      const peers = await host.federation.listPeers();
      return peers.map(({ serverName, latencyMs }) => ({
        serverName,
        latencyMs
      }));
    });
  }
});

為什麼需要 exine

ECCP 需要一個把 automation、可觀測性與延展性都當成產品特性的客戶端,而 exine 就是這個 Layer 3 表面。