bridge.mjs
28 lines 1.2 KB
Raw
sha256:65ccb454656ea5acdea0a10e559b78bcde1eb6ff753ecc2911bc99d1c3d7cadd feat(calendar): enforce agent context tiers in retrieval AP… Human minor ⚠ breaking 1 day ago
1 /**
2 * Netlify serverless wrapper for the Knowtation Hub Bridge.
3 * Use this when you deploy the bridge as a second Netlify site (same repo, redirect to this function).
4 * Set the bridge env vars in that site's dashboard; set BRIDGE_URL on the gateway to that site's URL.
5 * Attaches Netlify Blob store for persistent tokens + vector DBs.
6 */
7 import serverless from 'serverless-http';
8 import { connectLambda, getStore } from '@netlify/blobs';
9 import { app } from '../../hub/bridge/server.mjs';
10
11 export const handler = async (event, context) => {
12 connectLambda(event);
13 // Default `eventual` (fast). Set NETLIFY_BLOBS_CONSISTENCY=strong on the **bridge** site for
14 // read-after-write on vector blobs (index → search); see Netlify Blobs docs. If strong mode errors
15 // at runtime (e.g. missing edge URL), unset the env or revert to eventual.
16 const consistency =
17 String(process.env.NETLIFY_BLOBS_CONSISTENCY || '')
18 .trim()
19 .toLowerCase() === 'strong'
20 ? 'strong'
21 : 'eventual';
22 globalThis.__netlify_blob_store = getStore({ name: 'bridge-data', consistency });
23 try {
24 return await serverless(app)(event, context);
25 } finally {
26 delete globalThis.__netlify_blob_store;
27 }
28 };
File History 2 commits
sha256:65ccb454656ea5acdea0a10e559b78bcde1eb6ff753ecc2911bc99d1c3d7cadd feat(calendar): enforce agent context tiers in retrieval AP… Human minor 1 day ago
sha256:9103f98c89257ed2b01c237cea895dabb3e85ea337dccb1161c175e4422355b6 docs: accept Calendar Events v0 spec with Phase 0 security … Human 1 day ago