netlify.toml toml
84 lines 4.2 KB
Raw
sha256:c2dbf04d56308f3bbf2d06e6d2eb022b8948b1e827195fe525a44e5e18d5f9c0 feat(auth): Phase B Connect cloud agent (RFC 8628) + Hermes… Human minor ⚠ breaking 11 days ago
1 # Bridge Netlify site: set **Package directory** to `deploy/bridge` in the Netlify UI;
2 # leave **Base directory** empty so it defaults to the repo root. Per Netlify monorepo
3 # docs, `functions` and `publish` below are relative to the base directory (repo root),
4 # not to this folder — do not use `../..` here (that escapes the repo and fails deploy).
5 [build]
6 command = "npm install && node scripts/netlify-redirects.mjs && cd hub/gateway && npm ci && cd ../bridge && npm ci"
7 functions = "netlify/functions"
8 publish = "public"
9
10 [build.environment]
11 # Netlify’s build tooling can error on Node 22 (e.g. @netlify/build internal TypeError).
12 # Gateway site uses root netlify.toml with NODE_VERSION=20; bridge must pin the same.
13 NODE_VERSION = "20"
14 USE_BRIDGE_FUNCTION = "true"
15
16 # Bridge index/search loads sqlite-vec + better-sqlite3 native code; must not be esbuild-bundled
17 # (sqlite-vec getLoadablePath uses import.meta.url — bundling yields Invalid URL input '.').
18 [functions]
19 node_bundler = "esbuild"
20 external_node_modules = [
21 "better-sqlite3",
22 "sqlite-vec",
23 "sqlite-vec-linux-x64",
24 "sqlite-vec-linux-arm64",
25 "sqlite-vec-darwin-x64",
26 "sqlite-vec-darwin-arm64",
27 "sqlite-vec-windows-x64"
28 ]
29
30 # Back up now (/api/v1/vault/sync) can exceed the default ~10s limit (export + N proposal GETs + GitHub API).
31 # Align with gateway proxy budget (root netlify.toml [functions."gateway"] timeout = 60).
32 # Raised 26 → 60 (Netlify sync-function platform max per docs.netlify.com/build/functions/overview)
33 # so POST /api/v1/index has headroom under DeepInfra embedding latency. See
34 # `hub/bridge/index-timing.mjs` for per-step instrumentation that lets us identify
35 # which sub-step dominates before choosing parallelize/async as the next step.
36 # exceljs: see root netlify.toml [functions."bridge"] (large bundle; keep external for the bridge function).
37 [functions."bridge"]
38 timeout = 60
39 external_node_modules = ["exceljs"]
40 # Phase 2G hosted lazy-seed: resolveStarter* reads starter JSON at runtime (esbuild does not bundle fs paths).
41 included_files = [
42 "tasks/starter/*.json",
43 "task-loops/starter/*.json",
44 "task-loops/starter/instances/*.json",
45 "orchestrator-graphs/starter/*.json",
46 ]
47
48 # Background function: receives kickoff from the sync `bridge` function when the
49 # auto-routing preflight in `hub/bridge/server.mjs POST /api/v1/index` decides a
50 # re-index won't fit in 60 s (large vault, dim migration, first-time index, etc.).
51 # The `-background` filename suffix is what makes Netlify treat this as a
52 # background function (15-min platform max, returns 202 to caller within ~50 ms).
53 # See `netlify/functions/bridge-index-background.mjs` and
54 # `lib/bridge-index-preflight-estimate.mjs` for the routing math.
55 # external_node_modules: same as the sync bridge function (sqlite-vec native code,
56 # exceljs is large) — both functions import the same Express app and need the
57 # same modules left external.
58 [functions."bridge-index-background"]
59 external_node_modules = ["exceljs"]
60
61 # Send all requests to the bridge function with path preserved (/:splat).
62 #
63 # Why no explicit passthrough for /.netlify/functions/*: Netlify's redirect
64 # engine REJECTS user-defined rules whose `from` starts with `/.netlify/...`
65 # (validated at deploy time with "Invalid /.netlify path in redirect source").
66 # This rejection is intentional — per
67 # https://docs.netlify.com/routing/redirects/redirect-options/#shadowing the
68 # `/.netlify/...` namespace is automatically excluded from user redirects,
69 # INCLUDING catch-all rules with `force = true`. Direct calls to
70 # `/.netlify/functions/<name>` always reach their respective function
71 # regardless of what this catch-all says.
72 #
73 # The May 2026 PR #205 hotfix initially attempted to add an explicit
74 # passthrough here; it was rejected by Netlify validation and removed. The
75 # defense-in-depth guard now lives in `lib/bridge-index-kickoff-response.mjs`
76 # instead — that helper asserts the kickoff fetch actually got HTTP 202 (the
77 # only valid response from a Netlify background fn) so a future routing
78 # misconfiguration fails loudly instead of silently returning false success
79 # to the browser.
80 [[redirects]]
81 from = "/*"
82 to = "/.netlify/functions/bridge/:splat"
83 status = 200
84 force = true
File History 1 commit
sha256:93bcf8f9bd56d8c5b9339f4ec73b9ebd66571398d56262d38eedc2cfa9db9882 fix(test): align Band B landing assertion with desktop MCP … Human 11 days ago