The root cause: Obsidian's plugin loader expects main.js at the plugin root
alongside manifest.json. The previous 'dist/' output + shim approach caused
'Cannot find module ./dist/main.js' because dist/ was either missing or not
resolved correctly in Obsidian's module loader.
Changes:
- build: use esbuild to bundle all source into a single main.js (61KB)
tsc --noEmit for type checking; esbuild for the actual bundle
- main.js: no longer a shim — it's the fully bundled plugin
- package.json: added esbuild as devDependency; obsidian moved to devDeps
- install.sh: remove dist/ copy step, add cleanup of old dist/ from vault
- README.md: updated manual install steps to reflect bundling
- package.json: move obsidian from dependencies to devDependencies
(it is a type stub — having it in dependencies risks shadowing
Obsidian's built-in API if node_modules is present in the plugin folder)
- main.js: explicitly extract default export from dist/main.js so the
shim works with both plugin.default and direct-export loader patterns
- manifest.json: fix 'main' from 'src/main.js' to 'dist/main.js'
(TypeScript compiles to dist/, not src/ — Obsidian could not find the entry point)
- manifest.json: set isDesktopOnly to true (plugin requires a local Ollama server)
- package.json: remove unused node-fetch dependency (ESM-only, conflicts with CommonJS build)
- src/semantic-cache.ts: use dynamic import for chromadb instead of top-level import
(prevents plugin load crash when chromadb is not installed; cache defaults to disabled)
- install.sh: new script that installs deps, builds, and copies the plugin into a vault
- README.md: add quick install, manual install, and expanded troubleshooting sections
Update the plugin entrypoint and TypeScript output directory to use dist instead of writing generated JavaScript into src.
Remove previously checked-in compiled source files and add coverage for the Ollama client and tool executor.
Update error handling and improve streaming capabilities in the Ollama client and related components. Key changes
include:
- Simplify error types and improve error handling
- Refactor streaming logic to use async generators
- Update tool execution and vault indexing
- Improve utility functions and types
- Update test files to reflect changes