netlify.toml toml
63 lines 2.8 KB
Raw
sha256:700fafdd1afa490919f9515d660ca6e75456bcd5bb67513abcd8757a634c01f6 docs: record AIP-b SD-21 land (KN #308) Human 9 days ago
1 # Knowtation: gateway runs as a Netlify serverless function; static site is on 4Everland.
2 [build]
3 command = "npm install && node scripts/netlify-redirects.mjs && cd hub/gateway && npm ci && cd ../bridge && npm ci"
4 functions = "netlify/functions"
5 publish = "public"
6
7 [build.environment]
8 NODE_VERSION = "20"
9
10 # sqlite-vec uses `new URL('.', import.meta.url)` to find vec0.{so,dylib,dll}. Esbuild bundling
11 # breaks import.meta.url → TypeError Invalid URL (input '.'). Keep these external so Node loads
12 # real package files from node_modules (see sqlite-vec index.mjs getLoadablePath).
13 # stripe is external + lazy-loaded in billing-stripe.mjs to avoid bundling ~220 KB on cold start.
14 [functions]
15 node_bundler = "esbuild"
16 external_node_modules = [
17 "better-sqlite3",
18 "sqlite-vec",
19 "sqlite-vec-linux-x64",
20 "sqlite-vec-linux-arm64",
21 "sqlite-vec-darwin-x64",
22 "sqlite-vec-darwin-arm64",
23 "sqlite-vec-windows-x64",
24 "stripe"
25 ]
26
27 # exceljs is large; bundling it in esbuild for netlify/functions/bridge.mjs can fail Netlify
28 # (opaque exit 1, sometimes with @netlify/build TypeError in error formatting). Keep it
29 # external for the bridge function only so gateway.zip does not add node_modules/exceljs.
30 [functions."bridge"]
31 external_node_modules = ["exceljs"]
32 # Hosted lazy-seed: bridge reads starter JSON at runtime (tasks/loops/graphs + Flow v0).
33 included_files = [
34 "tasks/starter/*.json",
35 "task-loops/starter/*.json",
36 "task-loops/starter/instances/*.json",
37 "orchestrator-graphs/starter/*.json",
38 "flows/starter/*.json",
39 ]
40
41 # Netlify sync-function platform max is 60 s per docs.netlify.com/build/functions/overview.
42 # Per-function timeout must be a sub-table; a scalar `timeout = N` under [functions] is
43 # rejected by the config validator. Gateway raised from 26 → 60 to give the bridge-proxy
44 # index call (POST /api/v1/index) headroom under the DeepInfra (BAAI/bge-large-en-v1.5)
45 # embedding latency profile, which can run 2× the OpenAI text-embedding-3-small wall
46 # time for the same vault. See `hub/bridge/index-timing.mjs` and the timing logs
47 # (`type:knowtation_index_step`) in bridge logs to identify which sub-step dominates
48 # before deciding on a parallelize/async fix.
49 [functions."gateway"]
50 timeout = 60
51
52 [functions."warmup"]
53 timeout = 26
54
55 # Scheduled function: runs hourly, triggers consolidation for all due hosted users.
56 # Netlify scheduled functions run as background-style invocations (up to 15 min);
57 # 26 s is the declared limit here for safety — tune MAX_USERS_PER_RUN if needed.
58 [functions."consolidation-scheduler"]
59 timeout = 26
60
61 # Catch-all routing lives in public/_redirects (scripts/netlify-redirects.mjs). Do not add
62 # [[redirects]] here: in a monorepo, root netlify.toml settings apply to every linked site
63 # and would send the bridge deploy to the gateway function.
File History 1 commit
sha256:700fafdd1afa490919f9515d660ca6e75456bcd5bb67513abcd8757a634c01f6 docs: record AIP-b SD-21 land (KN #308) Human 9 days ago