- Streaming chat sidebar with OpenAI-compatible API client - Path-referencing context injection via MCP tools - Dark theme styling with Obsidian CSS variables - Settings: gateway URL, API key, context/model toggles - SSE streaming with fetch timeout protection - Session continuity via X-Hermes-Session-Id headers
25 lines
559 B
JavaScript
25 lines
559 B
JavaScript
import esbuild from "esbuild";
|
|
import process from "process";
|
|
|
|
const prod = process.argv.includes("production");
|
|
|
|
const context = await esbuild.context({
|
|
entryPoints: ["src/main.ts"],
|
|
bundle: true,
|
|
platform: "node",
|
|
external: ["obsidian"],
|
|
outfile: "main.js",
|
|
sourcemap: prod ? false : "inline",
|
|
minify: prod,
|
|
treeShaking: true,
|
|
logLevel: "info",
|
|
});
|
|
|
|
if (prod) {
|
|
await context.rebuild();
|
|
console.log("Production build complete.");
|
|
await context.dispose();
|
|
} else {
|
|
await context.watch();
|
|
console.log("Watching for changes...");
|
|
}
|