Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/gate/protocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -647,7 +647,7 @@ async function handleRequest(ctx: ProtocolContext, req: RequestFrameT): Promise<
const probeStart = Date.now();
let probeTtft: number | null = null;
const probeSession = startSession({
name: `probe-${Date.now()}`,
label: `probe-${Date.now()}`,
provider: providerName as ProviderName,
model: modelSpec ?? undefined
});
Expand Down
4 changes: 2 additions & 2 deletions src/gate/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,14 @@ export async function startJclawGate(options: JclawGateOptions) {
app.post("/webhook/whatsapp", express.json({
verify: (req, _res, buf) => {
// Stash the raw body buffer for signature verification below.
(req as Record<string, unknown>).rawBody = buf;
(req as unknown as Record<string, unknown>).rawBody = buf;
}
}), (req, res) => {
// ── Signature verification ─────────────────────────────────────────────
const cfg = { ...DEFAULT_WHATSAPP, ...(readConfig().whatsapp ?? {}) };
if (cfg.appSecret) {
const sigHeader = req.headers["x-hub-signature-256"];
const rawBody = (req as Record<string, unknown>).rawBody as Buffer | undefined;
const rawBody = (req as unknown as Record<string, unknown>).rawBody as Buffer | undefined;
if (!sigHeader || !rawBody) {
res.status(403).send("Forbidden");
return;
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"compilerOptions": {
"target": "ES2023",
"lib": ["ES2023"],
"types": ["node"],
"module": "ESNext",
"moduleResolution": "bundler",
"esModuleInterop": true,
Expand Down