Commit graph

87 commits

Author SHA1 Message Date
Bin-Home
32b76c6d88 chore: fix all ObsidianReviewBot lint errors, bump to v0.3.3
Resolves all Required issues flagged by the Obsidian community plugin
review bot:

- Replace explicit `any` types with typed interfaces and intersection
  types across providers, tools, UI components, and services
- Remove `async` from functions/methods with no `await`; return
  Promise.resolve() where the interface demands Promise<string>
- Replace `fetch` bare global with `window.fetch` and remove
  eslint-disable comments for no-restricted-globals
- Replace `globalThis.fetch` with `window.fetch` (prefer-active-doc)
- Replace string literal style assignments with template literals to
  satisfy no-static-styles-assignment; remove disable comments
- Fix sentence case: "Apply all" / "Reject all" in en.json
- Change default chats folder migration to use regex instead of
  hardcoded .obsidian/ path literal (hardcoded-config-path)
- Remove unnecessary type assertion in migrateSettings
- Remove await from non-Promise listFolder call (await-thenable)
- Add argsIgnorePattern to no-unused-vars in eslint.config.mjs

Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
2026-04-30 10:29:12 +08:00
Bin-Home
33d20f6e28 chore: add eslint-plugin-obsidianmd, fix lint errors, bump to v0.3.2
Migrate to ESLint v9 flat config, integrate obsidianmd plugin, fix all
required errors (prefer-active-window-timers, no-tfile-tfolder-cast,
no-unsupported-api, floating promises, etc.), and bump minAppVersion to
1.7.2 to match revealLeaf API requirement.

Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
2026-04-29 22:07:41 +08:00
Bin-Home
93276a7502 docs: replace BRAT install with Community plugins method
Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
2026-04-29 10:44:19 +08:00
Bin-Home
3e8bc8ec91 chore: remove docs/ from repo, ignore docs and tooling dirs
Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
2026-04-29 10:38:47 +08:00
Bin-Home
461dfc3a67 docs: add Obsidian disclosure section, bump version to 0.3.1
Adds required disclosures (account, payment, network use) to README and
README-cn.md per Obsidian developer policies.

Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
2026-04-29 10:36:48 +08:00
Bin-Home
3645669d8a chore: bump version to 0.3.0 2026-04-28 15:18:08 +08:00
Bin-Home
39b005af77 feat: add LM Studio as OpenAI-compatible local provider 2026-04-28 14:28:26 +08:00
Bin-Home
87803d50c5 feat: add Z.ai as separate provider, set glm-4.7 as Zhipu/Z.ai default model 2026-04-28 14:18:42 +08:00
Bin-Home
102257cb1d fix: include reasoningContent in msgTokens calculation
Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
2026-04-28 13:54:50 +08:00
Bin-Home
c15ed09d0a fix: persist reasoningContent through conversation serialize/parse roundtrip
Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
2026-04-28 13:54:02 +08:00
Bin-Home
d597110a73 test: verify multi-chunk reasoning content accumulation in agent loop 2026-04-28 13:48:02 +08:00
Bin-Home
4b9f144852 feat: store reasoning delta content on assistant messages in agent loop
Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
2026-04-28 13:43:44 +08:00
Bin-Home
ee38509a88 fix: cover toOpenAIMsg tool-call+reasoning branch in tests and normalize null content
Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
2026-04-28 13:41:35 +08:00
Bin-Home
1f7d83601d feat: stream reasoning_content from DeepSeek as reasoning deltas 2026-04-28 13:36:48 +08:00
Bin-Home
5df971de0d feat: add reasoningContent to Message and reasoning delta type 2026-04-28 13:31:54 +08:00
Bin-Home
96eefeb1c8 chore: bump version to 0.2.0 2026-04-27 21:39:10 +08:00
Bin-Home
654efe381c feat: rename plugin id and name to smart-note-agent / Smart Note Agent 2026-04-27 21:37:43 +08:00
Bin-Home
91c6dc9c72 fix: rename dist/main.css to dist/styles.css for Obsidian release 2026-04-27 20:05:21 +08:00
Bin-Home
a108cca958 ci: fix workflow shell safety, pin action SHAs, improve release quality 2026-04-27 19:52:07 +08:00
Bin-Home
e93292507c ci: add GitHub Actions release workflow 2026-04-27 19:47:39 +08:00
Bin-Home
62e62d9263 docs: GitHub Actions release implementation plan 2026-04-27 19:45:45 +08:00
Bin-Home
af25433d14 docs: GitHub Actions release workflow design spec 2026-04-27 19:44:30 +08:00
Bin-Home
66fcd45de2 docs: add LICENSE, fix dist path in README, sync zh-CN
Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
2026-04-26 21:32:23 +08:00
Bin-Home
c3b495d40e Update manifest.json 2026-04-25 19:26:02 +08:00
Bin-Home
ff6940cbba feat: rename to Obsidian Note Agent, fix default model display in status bar and indicator
- Plugin id/name updated to obsidian-note-agent (Bin-Home)
- Class renamed ObsidianAgentPlugin → ObsidianNoteAgentPlugin throughout
- VIEW_TYPE and default chatsFolder path updated to match new id
- Status bar and provider indicator button now use activeProfile() so
  the default model name shows instead of "-" when no override is set
- Indicator button separator changed from " / " to ":" to match status bar
- Add README.md and README-cn.md

Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
2026-04-25 17:36:45 +08:00
Bin-Home
3c39fdadea feat: user profile, auto-approve with backup, dist build, UX fixes
- Add user-profile "About Me" setting injected into every system prompt
- Chat history moved to .obsidian/plugins/obsidian-agent/chats (hidden from vault); auto-purge after 30 days
- Fix ApprovalQueue stuck state: re-insert entry on commit failure, always emit
- Fix list_folder returning only .md files (getMarkdownFiles → getFiles)
- Add auto-approve toggle in Edit mode: auto-commits writes, backs up originals to __auto_backup__/{timestamp}/{path}, shows Notice per backup
- Update DeepSeek default model to deepseek-v4-pro
- Build outputs to dist/ (main.js, styles.css, manifest.json); remove root build artifacts

Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
2026-04-25 16:44:17 +08:00
Bin-Home
a8f510cd86 feat: UX polish — provider reorder, custom provider, delete session, UI fixes
- Reorder providers: Chinese-first (DeepSeek, Qwen, Kimi, 智谱GLM, MiniMax,
  OpenAI, Anthropic, OpenRouter, Ollama, Custom)
- Add "Custom" provider with OpenAI/Anthropic compat selector
- Provider/model chip moved to input-box footer; click opens settings tab;
  updates immediately on settings change via onSettingsChange listener
- Textarea defaults to 3-row height
- Delete button (×) on conversation history rows with confirmation
- Note links in agent replies now navigate to the target note on click
- Remove duplicate Default Mode setting entry
- zh-CN: "首选语言" label

Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
2026-04-24 14:44:43 +08:00
Bin-Home
f3c45e40fc feat: full i18n coverage (en + zh-CN) across chat, history, settings
Translates remaining hardcoded UI strings — chat shell, conversation
history drawer, diff review, mode toggle, settings tab — and adds a
parity test so en.json and zh-CN.json key sets stay in lockstep.

Conversation list now uses sentinel group keys for ordering and
Intl.DateTimeFormat for locale-aware date rows.
2026-04-24 13:32:49 +08:00
Bin-Home
89b098d4a9 feat: per-provider settings profiles with default base URLs
Each provider now has its own apiKey / baseUrl / model stored under
settings.providers[id]. Switching providers no longer clobbers the
other one's credentials. Base URL shows the provider's default as
placeholder (empty = use default), and migrateSettings folds legacy
flat fields into the active provider's profile.

Also: API key input no longer masked, key/URL/model/chats-folder
inputs widened to a uniform half-row width, and chatsFolder changes
now apply without a reload.

Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
2026-04-24 13:08:34 +08:00
Bin-Home
6187400ba2 feat: auto-compaction + prompt caching via ContextManager
Replaces the simple token-budget trimmer with a ContextManager that derives
budgets from per-model context windows, auto-compacts older turns into a
rolling summary once pressure crosses a threshold, and exposes a stable
prefix boundary so providers with prompt caching (Anthropic) can reuse it.
Adds a "compacting" status in the UI and persists the summary alongside the
conversation.

Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
2026-04-24 11:29:04 +08:00
Bin-Home
83ffaf38bc feat: non-blocking edit mode with batched diff review
- Agent loop no longer awaits per-write approval; queues pending writes
  and returns { status: "queued" } to the LLM so multi-step edits finish
  in one turn. Diffs render inline under the assistant message that
  produced them, with per-block Approve/Reject and a bulk Apply All /
  Reject All footer.
- ApprovalQueue rewritten as a synchronous pending-writes store with an
  injected commit callback; clear() drops unresolved writes on view
  close or new conversation; scheduled (no-UI) runs auto-approveAll
  after the loop drains.
- history-trimmer keeps assistant-with-tool_calls + its tool responses
  as one atomic group so the provider never sees a tool message without
  its preceding tool_calls (fixes DeepSeek 400 on large tool bursts).
- Add pulsing thinking-dots indicator in MessageList whenever the turn
  is busy and streamBuf is empty, covering network latency, tool-call
  argument accumulation, and inter-iteration gaps.
- Drop [openai] console logs (errors/warns retained); remove superfluous
  aria-labels and title tooltips from chat UI.
- Add CLAUDE.md.

Co-Authored-By: Claude Opus 4 <noreply@anthropic.com>
2026-04-23 21:10:51 +08:00
Bin-Home
0d54000eea fix: sync model/provider from settings on every sendMessage call
conversation.model was set at conversation creation time and never
updated. Changing the model in settings had no effect until a new
conversation was started. Now sendMessage reads the current settings
before each request, so changes apply immediately.

Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
2026-04-23 18:00:10 +08:00
Bin-Home
a0c7ed036d feat: instant user message + live markdown streaming
1. User message now appears immediately on send, before the first
   network response arrives (optimistic update before the for-await loop).

2. Streaming response renders as formatted markdown in real-time using
   the same use:markdown action as finished messages. The version-guard
   in markdown-action.ts handles rapid updates without race conditions.
   Removed the redundant messages sync on every text chunk — streamBuf
   alone drives the live view, cutting unnecessary re-renders.

Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
2026-04-23 17:57:41 +08:00
Bin-Home
c960fc31ba fix: raise timeout default to 5min, show error on timeout, add setting
- Default turnTimeoutMs: 120s → 300s (5min). With retry backoff sleep
  up to 75s + a slow GLM response the old 120s was routinely exceeded.
- Timeout now yields a visible error instead of silently stopping:
  distinguishes DOMException AbortError (timeout) from user cancel.
- Adds "Request timeout (seconds)" field in plugin settings so users
  can tune it without touching code.

Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
2026-04-23 17:35:19 +08:00
Bin-Home
668b553b68 feat: Enter sends message, Shift+Enter inserts newline
Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
2026-04-23 17:12:30 +08:00
Bin-Home
5b65d76360 fix: text selection + informative tool result rows
1. Text selection: override Obsidian's global `user-select: none` on `*`
   with `user-select: text` on `.ml-root` and all its descendants.
   Buttons remain non-selectable.

2. Tool results: instead of just "tool result", each row now shows:
   - tool name (accent color)
   - first argument value as a hint (e.g. the search query)
   - result preview (e.g. "5 notes", "no results", "error: …")
   Hovering shows the full raw result in a tooltip.

Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
2026-04-23 16:45:23 +08:00
Bin-Home
0209be28fa feat: retry with exponential backoff on rate limit (429)
Both httpSSE (streaming) and httpJson now automatically retry up to 4
times when the provider responds with 429. Delays: 5s → 10s → 20s → 40s,
capped at 60s; respects Retry-After header when present.

Also fixes the agent loop to treat an AbortError during retry sleep as a
clean cancellation (stopped) rather than an error.

Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
2026-04-23 14:30:37 +08:00
Bin-Home
5ee4ac4efc fix: parse provider error JSON for cleaner rate-limit messages
Zhipu (and other providers) return JSON bodies on 429. Extract the
human-readable .error.message instead of dumping raw JSON to the user.

Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
2026-04-23 11:40:30 +08:00
Bin-Home
d63ccf2110 fix: show tool-call errors + add agent loop debug logging
Errors on the second LLM call (after a tool result) were being silently
wiped: ChatView's finally block overwrote `messages` with conversation
history, which doesn't include the transient error message. Fix tracks
the error in a local variable and re-appends it after the finally sync.

Also adds console.debug/warn/error throughout the agent loop so errors
are visible in Obsidian DevTools (Ctrl+Shift+I → Console).

Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
2026-04-23 11:25:21 +08:00
Bin-Home
9a64e32afb fix: output styles.css so Obsidian loads component CSS
esbuild writes Svelte CSS to main.css but Obsidian only reads styles.css
from the plugin folder. Copy main.css → styles.css after every build so
the redesigned component styles are actually loaded at runtime.

Co-Authored-By: Claude Sonnet 4 <noreply@anthropic.com>
2026-04-23 10:50:42 +08:00
Bin-Home
8a3d399ab2 build: update bundle with pinned New conversation button 2026-04-23 10:28:27 +08:00
Bin-Home
930b42a617 fix: pin New conversation button to bottom of history drawer 2026-04-23 10:28:22 +08:00
Bin-Home
7e1ea79321 build: production bundle for Cursor/document UI redesign 2026-04-23 10:22:58 +08:00
Bin-Home
d4b7e45977 feat: wire ConversationList events, expand history drawer to 220px 2026-04-23 10:19:27 +08:00
Bin-Home
0ddcaeefaf fix: remove double startNewConversation call, {@const} rowDate, fix ps shadowing 2026-04-23 10:17:39 +08:00
Bin-Home
556663eba5 feat: date-grouped history drawer with New conversation button 2026-04-23 10:11:19 +08:00
Bin-Home
5495599c6f fix: handle clipboard write failure in code block copy button 2026-04-23 10:09:40 +08:00
Bin-Home
402ccd81f6 feat: replace hover copy button with always-visible VS Code-style code header 2026-04-23 10:06:04 +08:00
Bin-Home
9741b67d8d fix: rename blink keyframe to ml-blink, fix :global(pre code) combinator 2026-04-23 10:05:00 +08:00
Bin-Home
28a86449cd feat: rewrite MessageList to alternating-band document layout 2026-04-23 09:59:33 +08:00