Verify that two concurrent BatchRunState objects don't interfere with
each other (cancelling one doesn't affect the other), and that stats
accumulate correctly when processing is stopped mid-iteration.
Change-Id: Id32b27307beafe49594cfde6fa818b2f22b87c66
Cover pre-aborted signal (aborted before fetch starts) and mid-read
abort (signal aborted while reading response body). Both verify that
abort listeners are properly cleaned up after rejection.
Change-Id: I0760f6ed051de1504e9b7aeead01a10cfd12476e
The previous code checked signal.aborted before adding the listener,
creating a timing window where the signal could abort between the check
and addEventListener. Now the listener is always registered first, then
signal.aborted is checked after, ensuring no abort event is missed.
Change-Id: I1abc3ad21e5bb93559d66922edf7c325a977bc65
normalizeSettings previously modified its input parameter in-place.
While callers already created copies before calling it, the function
signature was misleading. Now it creates a shallow copy internally and
operates on that, with a Readonly<PluginSettings> parameter type to
signal intent. Added a test verifying the original object is unchanged.
Change-Id: I7600ac37930bbcebb02aa7c84d8988cb7aa71196
The CLI path was not forwarding settings.apiMaxTokens, causing the
model to use its own default which is too small for long documents
with many CJK cards. This was the root cause of repeated "LLM 返回
非 JSON" errors — the JSON was being cut off mid-card.
Change-Id: Ia738418e2e6cf7f919752cb3128a82768d95cedf
- Add repairTruncatedCardsJson to recover complete cards when output
is cut off mid-card (e.g. token limit reached)
- Log raw LLM response to console on parse failure for debugging
- Make error panel text selectable and add "copy error" button
Change-Id: I4e76121138888234d42f84f3695cbbfd6beba886
- Fix CI to run all 4 test files (was missing direct-modules.test.js)
- Remove unused ESLint dependencies (eslint, @typescript-eslint/*, eslint-plugin-obsidianmd)
- Enable noImplicitReturns in tsconfig.json for stricter type safety
- Make applyApiProviderPreset return new object instead of mutating input
- Add per-file error handling in batch processing loop with error count in summary
- Narrow all catch clause types to unknown with proper instanceof narrowing
Change-Id: I76975dbd5ebdb5645d18c5858c8a52fd6da3405e
When a note has no cached parallel notes, the empty state now shows a
clickable "Generate" button so users can trigger generation directly
without going through the command palette. Closes#2.
Change-Id: I879897168ef77c44e0ab570e9c094fa9af9f66d4
The catch callback no longer contains any await expressions
after the previous refactor removed await on sync view methods.
Change-Id: I054c50fe209aba0e925bd1838896228bce686841
- Remove unnecessary TFile cast (instanceof already narrows)
- Remove await on non-Promise view methods (loadFor, renderLoading, renderError)
- Remove async from CacheManager.touch() (no await expression)
- Replace this-aliasing with captured locals in batch modal
- Use CSS class instead of inline style for modal input width
- Fix sentence case in settings UI text
Change-Id: I2a222c6429eb7e4d69761cca8369956fef510054
- Remove `parallel-reader-` prefix from command IDs (Obsidian auto-namespaces)
- Remove default hotkeys to avoid conflicts with user keybindings
- Replace `as TFile` casts with `instanceof TFile` checks
- Make onunload sync, remove detachLeavesOfType (preserves leaf positions)
- Use `vault.configDir` instead of hardcoded `.obsidian`
- Replace `window.confirm` with Obsidian Modal dialog
- Fix unhandled promises with `void` or `await`
- Remove unnecessary `async` from methods without `await`
- Use `new Setting().setHeading()` instead of raw HTML headings
- Fix promise-returning callbacks in event listeners
- Fix error type narrowing with `instanceof Error`
- Apply sentence case to UI text labels
Change-Id: I6e850d8a13b458d5cf1ad91227bf1772636b56b9
Register parallel-reader-batch-generate command. It prompts the user for a
folder path via a Modal, finds all .md files in that folder (non-recursive),
skips files whose cache is still valid, and runs runForFile() sequentially
on the rest, showing per-file progress notices. Add i18n keys for the new
UI strings in both zh and en.
https://claude.ai/code/session_016QvEfqw6YZ3RjwBHrJ4w8S
Promote noExplicitAny from warn to error and enable noNonNullAssertion
at warn level. Fix the two resulting errors in src/schema.ts by introducing
a JsonSchema interface to replace the any-typed local variables.
https://claude.ai/code/session_016QvEfqw6YZ3RjwBHrJ4w8S
Add streamingTimeoutMs field to PluginSettings (default 120000ms). In
streamingFetch(), use Promise.race between the stream reader and a timeout
promise that aborts the AbortController and throws a clear timeout error.
External cancellation signals are forwarded to the same controller so only
one abort path is needed.
https://claude.ai/code/session_016QvEfqw6YZ3RjwBHrJ4w8S
touchCacheEntry() now returns a new object via spread instead of mutating
the entry in-place. CacheManager.replaceCards() likewise creates a new entry
object instead of mutating existing fields. Update tests to assert the new
immutable semantics (returned value differs from input by reference).
https://claude.ai/code/session_016QvEfqw6YZ3RjwBHrJ4w8S
Define RequestUrlFunction, AnthropicMessagesBody, OpenAiChatBody,
OpenAiResponsesBody, GeminiBody/GeminiGenerationConfig typed interfaces.
Replace all ~14 any usages with unknown + type narrowing or concrete types.
Drop the eslint-disable comments that were papering over the any usages.
https://claude.ai/code/session_016QvEfqw6YZ3RjwBHrJ4w8S
Add CmEditorView, ObsidianEditorWithCm, ObsidianMenuItem, and ObsidianMenu
interfaces to src/types.ts. Replace (editor as any).cm and (it: any) casts
in main.ts with these typed wrappers, eliminating all any casts in the
scroll-sync and file-menu code paths.
https://claude.ai/code/session_016QvEfqw6YZ3RjwBHrJ4w8S
Move all cache persistence methods and state (_cacheSaveTimer, _cacheDirty)
into a new CacheManager class in src/cache-manager.ts. Plugin delegates to
it via thin wrappers that preserve the existing method names tested by the
test suite. main.ts reduced from 826 to 713 lines.
https://claude.ai/code/session_016QvEfqw6YZ3RjwBHrJ4w8S
Claude Code `--output-format json` returns a JSON array of event
objects, not a single object. Parse the array and extract the
result event. Also stop passing --model to let Claude Code use
its own default model. Revert timeout to 120s.
Change-Id: I5b5d4aa589ff78c0a2806a3e700bac0676a9b354
Switch to English as default README with badge bar (release, CI,
license, stars) and star-history chart. Add separate README.zh-CN.md
for Chinese version. Remove project structure section.
Change-Id: I3bc378bb024e1e75db95e08fd932b29e4d4b1c63
- Add description and authorUrl to manifest.json
- Bump version to 1.0.0
- Add versions.json mapping plugin version to min Obsidian version
Change-Id: Ic88d1219befe8433bf4eae7148a3d7383fd2af5d