mirror of
https://github.com/HKUDS/DeepTutor.git
synced 2026-12-01 23:59:55 +08:00
Memory. A v1.5.7 source deployment grew past 14 GB before V8 aborted; the
causes were independent, so this cut fixes each one and bounds what was
previously unbounded.
- The dev server was never actually capped: `next dev` renders in a worker it
spawns, and V8 flags in argv are not inherited, so
`node --max-old-space-size=4096 .../next dev` never reached the process
holding the memory. Next then substituted 50% of total RAM — a 12 GB heap on
a 24 GB machine. web/scripts/dev.mjs routes the ceiling through NODE_OPTIONS
(which the worker inherits and Next honors), clamped to 4 GB and sized off
the cgroup limit in a container.
- Source installs serve a production build: `deeptutor start` builds once into
.next-deeptutor and reuses it until a fingerprint over the web/ tree, the
version file, or the build-time public settings changes. `--dev` is the
opt-in for HMR and keeps using .next, so neither mode invalidates the other.
- LLM clients and providers come from a bounded event-loop-local LRU pool of 2
instead of one per turn, closed on shutdown and retired on a settings
reload; only the selected backend's SDK is imported.
- Caches gained ceilings: knowledge-task log streams cap events and bytes per
task with a 1h TTL and a completion tombstone, the completed-task table
keeps 256, the LlamaIndex index cache drops 8 -> 2 with a 10-minute idle
evict, and a book runtime is released when its queue drains.
- After a turn, a finished book job, or a completed KB task, cycles are
collected and glibc is asked to return free pages via malloc_trim; the
container and launcher set MALLOC_ARENA_MAX=2 and a lower trim threshold,
both operator-overridable.
- Every uvicorn launch sets --timeout-keep-alive 300. web/proxy.ts forwards
over Node's http.globalAgent, whose 5s idle reaper matched uvicorn's default
exactly; both ends raced to close the same socket and the loser's request
died with ECONNRESET ("Failed to load sessions").
- deeptutor.agents, deeptutor.core.agentic, provider_core, the document
extractor's parser libraries and the LLM error-mapping rules resolve on
first use. `python -m deeptutor.api.run_server` no longer reloads by
default (DEEPTUTOR_DEV_RELOAD=1 restores it).
README prose and all ten translated READMEs now describe the production-build
default instead of dev mode. Release notes: assets/releases/ver1-5-8.md
126 lines
4.0 KiB
TypeScript
126 lines
4.0 KiB
TypeScript
/**
|
|
* Catalog entry id → [Simple Icons](https://simpleicons.org) slug.
|
|
*
|
|
* The hand-curated half of the brand-icon pipeline. `brand-icons.generated.ts`
|
|
* is produced from this file plus the `simple-icons` package by
|
|
* `scripts/build-brand-icons.mts`, which **fails** on a slug that does not
|
|
* exist — so a typo here is a build error, not a silently missing icon.
|
|
*
|
|
* Why bundled rather than fetched: an icon per installed service, fetched at
|
|
* render time, tells that vendor (or a favicon proxy) who is looking and what
|
|
* else they have installed. Simple Icons is CC0, so the paths ship with the app
|
|
* and the browser makes no request at all. The upstream CLI-Anything hub and
|
|
* nanobot both hot-link a favicon chain; this is the same icons without the
|
|
* callout.
|
|
*
|
|
* Coverage is deliberately partial. The newer MCP brands (Exa, Tavily,
|
|
* Firecrawl, Apify, Jina, Context7, Linkup, Browserbase, Hyperbrowser, FastMCP,
|
|
* DeepWiki) are not in Simple Icons at all, and a wrong-but-present logo is
|
|
* worse than an initials monogram. Anything absent here falls back to the
|
|
* monogram, which is a fine second-class citizen.
|
|
*
|
|
* ADDING ONE: find the slug at simpleicons.org, add a line, re-run
|
|
* `npm run build:brand-icons`. Trademarks belong to their owners; these marks
|
|
* identify a product and imply no endorsement (see the notice in the stores).
|
|
*/
|
|
|
|
/** MCP catalog ids (`deeptutor/services/mcp/catalog/vendor/curated.json`). */
|
|
export const MCP_BRAND_SLUGS: Readonly<Record<string, string>> = {
|
|
airtable: "airtable",
|
|
"baidu-maps": "baidu",
|
|
"brave-search": "brave",
|
|
"chakra-ui": "chakraui",
|
|
clerk: "clerk",
|
|
"cloudflare-docs": "cloudflare",
|
|
convex: "convex",
|
|
github: "github",
|
|
// The server is a thin wrapper over git hosting; the git mark is the honest one.
|
|
gitmcp: "git",
|
|
"google-maps": "googlemaps",
|
|
huggingface: "huggingface",
|
|
neon: "neon",
|
|
postman: "postman",
|
|
pubmed: "pubmed",
|
|
stripe: "stripe",
|
|
supabase: "supabase",
|
|
svelte: "svelte",
|
|
wolfram: "wolfram",
|
|
zapier: "zapier",
|
|
};
|
|
|
|
/** CLI app ids (`deeptutor/services/cli_apps/vendor/catalog.json`). */
|
|
export const CLI_BRAND_SLUGS: Readonly<Record<string, string>> = {
|
|
"1password-cli": "1password",
|
|
adguardhome: "adguard",
|
|
"android-cli": "android",
|
|
"arcgis-pro": "arcgis",
|
|
audacity: "audacity",
|
|
blender: "blender",
|
|
// Both browser harnesses drive Chrome over the DevTools protocol.
|
|
browser: "googlechrome",
|
|
"browser-cdp": "googlechrome",
|
|
// A Rust CLI with no brand of its own.
|
|
clibrowser: "rust",
|
|
contentful: "contentful",
|
|
"dify-workflow": "dify",
|
|
drawio: "diagramsdotnet",
|
|
elevenlabs: "elevenlabs",
|
|
"eth2-quickstart": "ethereum",
|
|
firefly: "fireflyiii",
|
|
"firefly-iii": "fireflyiii",
|
|
freecad: "freecad",
|
|
"generate-veo-video": "googlegemini",
|
|
gimp: "gimp",
|
|
godot: "godotengine",
|
|
"hacker-feeds-cli": "ycombinator",
|
|
inkscape: "inkscape",
|
|
iterm2: "iterm2",
|
|
jimeng: "bytedance",
|
|
joplin: "joplin",
|
|
kdenlive: "kdenlive",
|
|
krita: "krita",
|
|
libreoffice: "libreoffice",
|
|
// The debugger ships with LLVM and has no mark of its own.
|
|
lldb: "llvm",
|
|
mailchimp: "mailchimp",
|
|
mermaid: "mermaid",
|
|
minimax: "minimax",
|
|
"minimax-cli": "minimax",
|
|
n8n: "n8n",
|
|
notebooklm: "googlegemini",
|
|
"nsight-graphics": "nvidia",
|
|
"obs-studio": "obsstudio",
|
|
obsidian: "obsidian",
|
|
"obsidian-agent-cli": "obsidian",
|
|
"obsidian-cli": "obsidian",
|
|
ollama: "ollama",
|
|
pm2: "pm2",
|
|
// An R package for clinical reporting.
|
|
py4csr: "r",
|
|
qgis: "qgis",
|
|
safari: "safari",
|
|
sanity: "sanity",
|
|
sentry: "sentry",
|
|
shopify: "shopify",
|
|
siyuan: "siyuan",
|
|
sketch: "sketch",
|
|
slay_the_spire_ii: "steam",
|
|
suno: "suno",
|
|
ueatelier: "unrealengine",
|
|
unrealinsights: "unrealengine",
|
|
// WeCom is WeChat Work; Simple Icons carries only the WeChat mark.
|
|
wecom: "wechat",
|
|
zoom: "zoom",
|
|
zotero: "zotero",
|
|
};
|
|
|
|
/** Every slug the generated file has to contain, deduplicated. */
|
|
export function referencedSlugs(): string[] {
|
|
return [
|
|
...new Set([
|
|
...Object.values(MCP_BRAND_SLUGS),
|
|
...Object.values(CLI_BRAND_SLUGS),
|
|
]),
|
|
].sort();
|
|
}
|