commune-ai 0.2.64 → 0.2.65
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 +10 -10
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
#
|
|
1
|
+
# commune-ai
|
|
2
2
|
|
|
3
3
|
Commune is the **communication infrastructure for agents**. It gives your agent a **unified inbox**
|
|
4
4
|
for **email**, so your agent can talk to humans where they already work. Most teams
|
|
@@ -30,7 +30,7 @@ This is the simplest full flow: receive webhook → run agent → reply in threa
|
|
|
30
30
|
|
|
31
31
|
```ts
|
|
32
32
|
import express from "express";
|
|
33
|
-
import { CommuneClient, createWebhookHandler, verifyCommuneWebhook } from "
|
|
33
|
+
import { CommuneClient, createWebhookHandler, verifyCommuneWebhook } from "commune-ai";
|
|
34
34
|
|
|
35
35
|
const client = new CommuneClient({ apiKey: process.env.COMMUNE_API_KEY! });
|
|
36
36
|
|
|
@@ -82,7 +82,7 @@ app.listen(3000, () => console.log("listening on 3000"));
|
|
|
82
82
|
|
|
83
83
|
## 0) Install
|
|
84
84
|
```bash
|
|
85
|
-
npm install
|
|
85
|
+
npm install commune-ai
|
|
86
86
|
```
|
|
87
87
|
|
|
88
88
|
---
|
|
@@ -197,7 +197,7 @@ Commune provides powerful semantic search capabilities to help your agent find r
|
|
|
197
197
|
|
|
198
198
|
### Basic Search
|
|
199
199
|
```ts
|
|
200
|
-
import { CommuneClient } from "
|
|
200
|
+
import { CommuneClient } from "commune-ai";
|
|
201
201
|
const client = new CommuneClient({ apiKey: process.env.COMMUNE_API_KEY! });
|
|
202
202
|
|
|
203
203
|
// Search across all conversations in an organization
|
|
@@ -347,7 +347,7 @@ This ensures your domain maintains high deliverability and isn't flagged by emai
|
|
|
347
347
|
If a spam email gets through, you can report it:
|
|
348
348
|
|
|
349
349
|
```ts
|
|
350
|
-
import { CommuneClient } from "
|
|
350
|
+
import { CommuneClient } from "commune-ai";
|
|
351
351
|
const client = new CommuneClient({ apiKey: process.env.COMMUNE_API_KEY! });
|
|
352
352
|
|
|
353
353
|
// Report a message as spam
|
|
@@ -364,7 +364,7 @@ The system learns from reports and automatically blocks repeat offenders.
|
|
|
364
364
|
Commune stores conversation state so your agent can respond with context.
|
|
365
365
|
|
|
366
366
|
```ts
|
|
367
|
-
import { CommuneClient } from "
|
|
367
|
+
import { CommuneClient } from "commune-ai";
|
|
368
368
|
const client = new CommuneClient({ apiKey: process.env.COMMUNE_API_KEY! });
|
|
369
369
|
|
|
370
370
|
// Thread history (email thread)
|
|
@@ -394,7 +394,7 @@ The `UnifiedMessage` shape works for email messages.
|
|
|
394
394
|
|
|
395
395
|
```ts
|
|
396
396
|
import express from "express";
|
|
397
|
-
import { CommuneClient, createWebhookHandler } from "
|
|
397
|
+
import { CommuneClient, createWebhookHandler } from "commune-ai";
|
|
398
398
|
|
|
399
399
|
// Hosted API is default. If self-hosted, pass { baseUrl: "https://your-api" }
|
|
400
400
|
const client = new CommuneClient({ apiKey: process.env.COMMUNE_API_KEY! });
|
|
@@ -528,7 +528,7 @@ const handler = createWebhookHandler({
|
|
|
528
528
|
|
|
529
529
|
### Example: Invoice extraction (end-to-end)
|
|
530
530
|
```ts
|
|
531
|
-
import { CommuneClient, createWebhookHandler } from "
|
|
531
|
+
import { CommuneClient, createWebhookHandler } from "commune-ai";
|
|
532
532
|
|
|
533
533
|
const client = new CommuneClient({ apiKey: process.env.COMMUNE_API_KEY! });
|
|
534
534
|
|
|
@@ -571,7 +571,7 @@ Commune signs outbound webhooks using your **inbox webhook secret**. Verify the
|
|
|
571
571
|
signature before processing the request.
|
|
572
572
|
|
|
573
573
|
```ts
|
|
574
|
-
import { createWebhookHandler, verifyCommuneWebhook } from "
|
|
574
|
+
import { createWebhookHandler, verifyCommuneWebhook } from "commune-ai";
|
|
575
575
|
|
|
576
576
|
const handler = createWebhookHandler({
|
|
577
577
|
verify: ({ rawBody, headers }) => {
|
|
@@ -603,7 +603,7 @@ A complete copy‑paste example that:
|
|
|
603
603
|
|
|
604
604
|
```ts
|
|
605
605
|
import express from "express";
|
|
606
|
-
import { CommuneClient, createWebhookHandler } from "
|
|
606
|
+
import { CommuneClient, createWebhookHandler } from "commune-ai";
|
|
607
607
|
import fs from "fs";
|
|
608
608
|
|
|
609
609
|
const client = new CommuneClient({ apiKey: process.env.COMMUNE_API_KEY! });
|
package/package.json
CHANGED