PushNotifiMe
4
面向 AI agent 的人在回路(在你的手机上)。agent 调用 pushnotifi_request_ack,你在 PushNotifi 手机应用上点按批准/拒绝或回复,agent 的 pushnotifi_await_ack 返回你的答复并继续工作流。
4 条规则
webhook-resilience:
- Every webhook handler must catch errors at the handler boundary. Do not let an unhandled rejection or thrown error reach the platform default error page; that path produces no alert.
- On failure, send a PushNotifi notification using the `pushnotifime` SDK (Node) or `POST /api/v1/message` (other languages). Include:
- `title`: short, identifying source (e.g. `Stripe webhook failure`)
- `message`: the error message and the relevant external id (event id, order id), no secrets
- `priority`: `1` for must-investigate, `0` for informational
- `idempotency_key`: a stable string derived from the webhook event id (e.g. `stripe:evt_…`). Do **not** derive it from `Date.now()` or a random value — that defeats deduplication on retries.
- Reply to the webhook source with the response status the source expects (typically `200` once accepted, `4xx` for permanent rejection, `5xx` for transient). Do not return `200` on internal failure unless you have already enqueued the work for retry; otherwise the source will not retry and the failure is lost.
- Verify the source signature *before* doing any work. On signature mismatch, send a PushNotifi alert with `priority: 1` and respond `401`. Signature failures are a security signal, not a normal-path event.
- Do not log raw request bodies. Webhook payloads frequently contain PII or tokens.
- For high-volume webhooks, throttle alerts: alert on the first failure of a given `idempotency_key` and suppress repeats for at least 5 minutes. The PushNotifi API enforces idempotency on the server, but client-side throttling avoids the round trip.
- Read keys from environment variables only; see the `pushnotifi-secrets` rule.
Skeleton (Node, Next.js route handler):
```ts
import { NextRequest, NextResponse } from "next/server";
import { PushNotifiMe } from "pushnotifime";
const pn = new PushNotifiMe(process.env.PUSHNOTIFI_USER_KEY!);
export async function POST(req: NextRequest) {
const sig = req.headers.get("x-source-signature");
let event: { id: string; type: string };
try {
event = await verifyAndParse(req, sig);
} catch (err) {
await pn.send({
type: "group",
send_to_key: process.env.PUSHNOTIFI_GROUP_KEY!,
title: "Webhook signature mismatch",
message: (err as Error).message,
priority: 1,
idempotency_key: `sig-fail:${sig ?? "missing"}`,
});
return new NextResponse("invalid signature", { status: 401 });
}
try {
await processEvent(event);
return new NextResponse("ok", { status: 200 });
} catch (err) {
await pn.send({
type: "group",
send_to_key: process.env.PUSHNOTIFI_GROUP_KEY!,
title: "Webhook processing failed",
message: `${event.type} ${event.id}: ${(err as Error).message}`,
priority: 1,
idempotency_key: `wh:${event.id}`,
});
return new NextResponse("retry", { status: 500 });
}
}
```相关插件
PushNotifiMe↓ 0
把 AI agent 的人在回路环节搬到你的手机上。agent 调用 pushnotifi_request_ack,你在 PushNotifi 手机应用上点按批准/拒绝/是/否(或输入回复),agent 的 pushnotifi_await_ack 返回你的答案后工作流继续。GitHub MCP Server↓ 39
GitHub MCP Server:访问仓库数据、用户画像、Trending、提交历史与开源分析。Code Quality Scanner↓ 30
Code Quality Scanner:AST 分析检测 AI 生成代码中的 vibe-code 反模式(Python/JS/Prompt)。Yahoo Finance MCP Server↓ 17
通过 Yahoo Finance 获取实时股票报价、财务报表、分析师推荐、期权链与全面市场数据,为 AI agent 提供实时金融情报,服务投资研究与组合分析。Easy Notion MCP↓ 12
面向 Cursor 的 Notion MCP 插件。Rootly MCP server↓ 9
将 Rootly 接入 Cursor,把事件、告警、值班排班与复盘作为原生 MCP 工具使用。humanpages↓ 7
雇佣真人完成 agent 无法独立完成的任务,例如 QA 测试、目录提交、Beta 测试、本地化审校、竞品监控等,无需浏览器、手动竞价或平台费用。Weather MCP Server↓ 6
提供天气预报、气候数据、历史天气模式和恶劣天气预警的 MCP 服务器,由 Apify 云基础设施驱动。