Commit graph

10 commits

Author SHA1 Message Date
wujunchen
b7d1a25543 security: strip path traversal segments from vault paths
Reject '..' and '.' segments in normalizeVaultPath to prevent
exportFolder from escaping the vault root directory.

Change-Id: Ib4da19f9d0aa1236a3b77b6f2cc722fcff408131
2026-04-26 09:48:19 +08:00
wujunchen
447ad1414b feat: add streaming API responses for OpenAI Chat and Anthropic
Implement SSE streaming for API backends that support it (OpenAI Chat
Completions and Anthropic Messages). During generation the view shows
a live streaming preview with accumulated text. Adds a streaming toggle
in settings (enabled by default). Non-streaming-capable formats (Gemini,
OpenAI Responses) and CLI backends continue using the existing path.

Change-Id: I3361a5ca5aec3e25a7d16e4fb585185f6fc0695e
2026-04-26 09:30:51 +08:00
wujunchen
3b02cfa480 test: add comprehensive unit tests for pure modules
Cover anchor, schema, cache, cards, navigation, markdown, vault, i18n,
scroll, settings, prompt, providers, and generation-job-manager modules
with focused assertions testing edge cases and expected behavior.

Change-Id: I49e1f104e04a3dbafe66c19adf24ac5d0e3a7c54
2026-04-26 09:25:23 +08:00
wujunchen
532cd31ef4 refactor: extract View, Modal, and SettingsTab from main.ts
Move ParallelReaderView to src/view.ts (341 lines),
CardEditModal to src/modal.ts (56 lines),
ParallelReaderSettingTab to src/settings-tab.ts (370 lines).
Add PluginHost interface in types.ts to break circular deps.
main.ts reduced from 1613 to 588 lines.

Change-Id: I90902e914f162ff92b9a7f7c190b4d397a2c8c12
2026-04-25 23:40:56 +08:00
wujunchen
d8880d41b2 refactor: split UI helpers module
Change-Id: I1abcd20b75608261b2d004550c011eeba76d35bf
2026-04-25 21:32:32 +08:00
wujunchen
5f6f18677b refactor: split CLI backend module
Change-Id: I7450dface429972b71b173973e6f71393d83303e
2026-04-25 19:58:29 +08:00
wujunchen
206a50f8d0 fix: guard regeneration and scroll sync
Change-Id: I08e2c55d5e88a51bad9a007e57962ebe48dc7c64
2026-04-25 19:52:27 +08:00
wujunchen
5c2c97fdbe feat: improve reader cache and card UX
Change-Id: Ie1b5c5ba1a6538b701af2591effd1845dca2f670
2026-04-25 19:44:39 +08:00
wujunchen
08f510c65c refactor: split prompt and add localized UI
Move prompt and anchor matching into dedicated modules, add Chinese/English UI translation support, and cover cache fingerprint and translation behavior with tests.

Change-Id: Ieadc2197cba31cf750b83e2893909127da8ecca5
2026-04-25 15:15:26 +08:00
wujunchen
1fada9f472 feat: add TypeScript build and provider architecture
Introduce an esbuild/TypeScript source layout while keeping the generated Obsidian main.js entrypoint. Add provider-format adapters, structured-output requests, settings-aware bounded cache, prompt controls, concurrency guards, and regression tests.

Change-Id: I8ecbc4c6eff3925249778732bd75747619b818e4
2026-04-25 14:12:17 +08:00