bridge.mjs
29 lines 1.3 KB
Raw
sha256:87f84653ce4706be8c65b0c4494ed6fb891213cca82db2b1824772cddc41a752 feat(auth): durable MCP OAuth refresh via shared strong sto… Agent minor 57 days 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) for the store handle. Calendar OAuth hydrate still passes
14 // `consistency: 'strong'` per get (see hub/bridge/calendar-blob-store.mjs) so begin→callback
15 // read-after-write does not return state_invalid. Set NETLIFY_BLOBS_CONSISTENCY=strong on the
16 // **bridge** site to also force strong for index/vector reads; see Netlify Blobs docs.
17 const consistency =
18 String(process.env.NETLIFY_BLOBS_CONSISTENCY || '')
19 .trim()
20 .toLowerCase() === 'strong'
21 ? 'strong'
22 : 'eventual';
23 globalThis.__netlify_blob_store = getStore({ name: 'bridge-data', consistency });
24 try {
25 return await serverless(app)(event, context);
26 } finally {
27 delete globalThis.__netlify_blob_store;
28 }
29 };
File History 5 commits
sha256:87f84653ce4706be8c65b0c4494ed6fb891213cca82db2b1824772cddc41a752 feat(auth): durable MCP OAuth refresh via shared strong sto… Agent minor 57 days ago
sha256:873e30b7fafe601346295f8f4289f388f21d8f715f28584d5481899ba2b714fc Merge pull request #249 from aaronrene/muse-mirror Agent 74 days ago
sha256:d8c648b20a4d53b2673c5c082ee7edfa7b2fc9b11080832da1f38807b6bf940b fix(7C-L1b): route hosted delegation proposals through cani… Human minor 76 days ago
sha256:2827ba9e7632a4b141c50caf1e8f7d77abbc3515be20e7465f2bccb0ac4edf91 fix: repair endpoint now sets has_active_subscription when … Human minor 96 days ago