Commit graph

55 commits

Author SHA1 Message Date
Yan
bf07e29d53 release: 2.0.1 2026-05-20 23:35:40 +08:00
Yan
94d30fe962 Merge release/2.0.0 into main — v2.0.0 Knowledge-to-Action Foundation 2026-05-20 23:35:07 +08:00
Yan
4ff3200415 fix: modal closes on save + richer plan generation
Bug fix: Result modal now closes before executing any action (save/insert/
concept/plan). Previously save actions (saveAsNote, saveAsPlan) ran without
closing the modal, allowing duplicate saves.

Plan generation prompt rewritten to produce full documents:
  - 目标 (what the plan achieves)
  - 背景 (context from source note)
  - 行动项 (grouped, with deliverables and time estimates)
  - 关键依赖 (prerequisites)
  - 风险与注意 (blockers)
  - 验收标准 (definition of done)

Before: plan was just a flat checkbox list.
After: plan is a complete actionable document.
2026-05-20 23:14:33 +08:00
Yan
ad0856e5b3 fix(result-modal): close on save, professional plan template, unify plan→artifact
Bug fix:
  - Modal now closes immediately on any save action (doAction guard
    prevents double-save via this.closed flag)

Plan template professionalized:
  - 'Save as plan' now creates a structured note with:
    frontmatter (type: plan, status: active, source link)
    目标 section (user fills)
    行动项 section (AI-generated content goes here)
    时间线 table
    风险与依赖
    完成标准 (checkboxes)
    复盘 section
  - Not just a raw AI dump with checkboxes

Unified plan → artifact:
  - 'From current note generate plan' (执行 domain) now opens
    Artifact Builder with preset artifactType='plan'
  - Removed 70+ lines of duplicated plan generation logic from main.ts
  - ArtifactBuilderModal accepts optional presetType parameter
  - ArtifactFeatureController.openBuilderWithPreset() supports presets

Result: 'execution plan' and 'execution artifact' are now the same system.
Users interact with one concept: Execution Artifact (which can be a plan,
checklist, routine, SOP, review, etc.)
2026-05-20 23:01:40 +08:00
Yan
369857bc63 feat(result-modal): smart actions + mobile-safe layout
Result preview modal redesigned:

Smart action system:
  - System auto-recommends the best primary action based on mode + content
  - mode=replace → '替换选中内容'
  - mode=insert → '插入到光标位置' + optional '保存为新笔记'
  - mode=append → '追加到文档末尾' + '保存为新笔记'
  - mode=show → auto-detects:
    - Content has checkboxes → '保存为执行计划' (→ Knowledge/Plans/)
    - Content looks like concept → '创建为概念页'
    - Default → '保存为新笔记' (→ Knowledge/Notes/)
  - Secondary actions: max 2, context-dependent
  - Always available: '重新生成' + '关闭'
  - '复制到剪贴板' as secondary for replace/insert

Mobile fix:
  - Modal uses flex column layout with max-height: 80vh
  - Preview area: flex: 1, scrollable, capped at 55vh (40vh on mobile)
  - Action bar: flex-shrink: 0, fixed at bottom, never hidden
  - Mobile breakpoint (600px): buttons wrap full-width, equal sizing

New save targets (auto-routed, user doesn't choose directories):
  - Knowledge/Notes/     for general AI outputs
  - Knowledge/Plans/     for content with checkboxes
  - Knowledge/Concepts/  for concept-like content (via existing flow)
2026-05-20 22:45:35 +08:00
Yan
80abd101b6 feat(build): append timestamp build number to dist version
Production builds now output version as '2.0.0+YYYYMMDDHHmm' in
dist/manifest.json. Source manifest.json stays at '2.0.0'.

This allows identifying exact builds without bumping the semver,
useful during development and beta testing.
2026-05-20 22:32:11 +08:00
Yan
22dfb1becf fix(plan): execution plan generates actual plan content, not internal ops
Before: 'generate plan' asked AI for JSON of vault operations (create-file,
append-section, etc.) and saved a technical PlanDraftStore note. User saw
internal file paths and operation types — not useful.

After: 'generate plan' asks AI to produce the plan itself — action items,
deadlines, priorities — as readable Markdown with checkboxes. The result
is previewed (like AI assistant), then saved as a normal plan note under
Knowledge/Plans/ with frontmatter type: plan.

The plan note looks like what you'd actually use:
  # 本周执行计划
  > 来源:[[2026-05-20 项目会议]]
  ## 高优先级
  - [ ] 完成 API 设计文档(周三前)
  - [ ] 和前端对齐接口规范
  ## 常规
  - [ ] 更新文档
  ...

PlanDraftStore/PlanExecutor remain for system-level batch operations
(artifact multi-file saves, scheduler tasks). User-facing 'plans' are
just knowledge notes with checkboxes.
2026-05-20 22:26:48 +08:00
Yan
3cf38ba59e fix(execution): plan drafts are now human-readable, confirm-execute flow added
Before:
  - Plan draft notes contained raw JSON at the bottom
  - No way to execute a pending plan from the UI
  - User saw technical payload with no clear next step

After:
  - Plan drafts are clean markdown: summary table + operation list + affected
    files + detailed preview. No JSON visible.
  - Raw plan data cached in PlanDraftStore memory (not in note)
  - New action: '确认执行此计划' (icon: play)
    - Only visible when current file has type: execution-plan
    - Shows confirmation dialog with risk level and file count
    - Executes via PlanExecutor, marks draft as 'executed'
    - On failure: shows error, draft stays pending
  - PlanDraftStore.getPendingPlans() for listing
  - PlanDraftStore.markExecuted() updates note status

Execution flow now:
  1. Generate plan → save as readable draft note
  2. User opens and reviews the plan
  3. User triggers '确认执行此计划' from command panel or right-click
  4. Confirmation dialog → execute → log written → draft marked done

Limitation: plan cache is in-memory only. If Obsidian restarts between
plan creation and confirmation, user must regenerate. This is acceptable
for v2.0; persistent plan storage comes in v2.1.
2026-05-20 22:15:33 +08:00
Yan
e262d6c0ad fix(reading): chapter files prefixed with zero-padded number for sort order
Before: 婴儿喂养.md, 新生儿护理.md (random alphabetical order)
After:  01-婴儿喂养.md, 02-新生儿护理.md (natural reading order)

- createChapterNote: filename = '{NN}-{title}.md'
- writeChapterQuestions: uses same pattern to locate files
- createIndexPage: links use [[NN-title|title]] format

This ensures Obsidian's file tree displays chapters in reading order
regardless of the user's sort setting.
2026-05-20 22:07:13 +08:00
Yan
25eb0bc04c fix(rc): address all P0/P1 review items for 2.0 RC
P0: tsconfig lib upgraded from ES6 to ES2018 (matches esbuild target,
    eliminates Object.entries type risk)

P1: sourceLinks format safety
  - Prompt explicitly forbids [[]] in sourceLinks
  - ArtifactRenderer.wikiLink() strips accidental double-wrapping
  - All sourceLinks rendering uses wikiLink() helper

P1: High-risk content disclaimer
  - ArtifactRenderer.needsSafetyDisclaimer() detects sensitive keywords
    (health/baby/medical/legal/investment) and high-risk items
  - Automatically prepends warning callout to template/run output

P1: Preview shows concrete file paths
  - ArtifactPreviewModal shows exact Knowledge/Artifacts/xxx.md and
    Knowledge/Artifact Runs/yyyy xxx.md paths instead of '1-2 files'

P1: README Architecture tree updated with core/artifact + features/artifact
P1: README Configuration table corrected to match actual settings page

P2: YAML frontmatter escaping
  - ArtifactRenderer.yamlStr() uses JSON.stringify for safe YAML scalars
  - title and target fields no longer break on quotes/special chars

P2: Prompt clarifies 'do not fabricate sourceLinks'
2026-05-20 18:33:51 +08:00
Yan
2bf2032b5d refactor(artifact): extract ArtifactFeatureController, address review items
- Extracted all artifact orchestration from main.ts into
  src/features/artifact/ArtifactFeatureController.ts
  (main.ts now has a 3-line delegation method)

- gatherContext() now receives full params (uses target + artifactType
  for richer related-vault queries instead of just basename)

- Fixed reading-project path matching: f.path.startsWith(folder + '/')
  prevents matching sibling directories with same prefix

- ArtifactPreviewModal now shows 'will create 1-2 files' impact notice

- PlanDraftStore now includes full ExecutionPlan JSON in a code block
  (enables future 'confirm and execute from draft' workflow)

- README Status table updated with Execution Artifact Builder row

- main.ts reduced from ~900+ to 874 lines (artifact logic externalized)
2026-05-20 18:14:41 +08:00
Yan
62b0be19b4 feat(artifact): Execution Artifact Builder — knowledge-to-action foundation
Core model (src/core/artifact/):
  - types.ts: ArtifactType (checklist/routine/sop/plan/review/question-list/
    decision/custom), ArtifactItem with sourceLinks/inferred/riskLevel/recordFields,
    ExecutionArtifact, ArtifactBuildParams, label maps
  - ArtifactPromptBuilder.ts: system + user prompt construction
  - ArtifactRenderer.ts: renders template and run markdown with frontmatter,
    grouped items, source links, inferred warnings
  - ArtifactValidator.ts: normalize + validate with stats

Feature (src/features/artifact/):
  - ArtifactBuilderModal: 5-question structured builder (type/target/usage/
    source/evidence) with auto-detected context
  - ArtifactPreviewModal: stats bar + rendered preview + save choices

Plugin integration:
  - openArtifactBuilder(): auto-detects selection/reading-project/note context
  - runArtifactGeneration(): gathers context by scope, calls LLM, validates
  - saveArtifactTemplate(): writes to Knowledge/Artifacts/
  - saveArtifactTemplateAndRun(): template + today's execution record
  - gatherArtifactContext(): resolves selection/note/reading-project/vault/freeform

Action: 'create-artifact' in knowledge domain (icon: file-check)
PlanSource: added 'artifact'

Command panel now:
  入口: AI 助手
  知识: 知识库问答, 知识提问, 从当前知识生成执行资产, 补全概念, 扫描空概念, 阅读项目, 知识债务
  执行: 生成执行计划, 查看待确认计划, 查看执行日志, 定时任务
  辅助: 美化文档, 百度云同步
2026-05-20 17:44:29 +08:00
Yan
9d2a0c08ba feat(panel): execution module visible + icon professionalization
Command panel now shows all three domains with actions:
  入口: AI 助手 (pinned)
  知识: 知识库问答, 知识提问, 补全概念, 扫描空概念, 阅读项目, 知识债务
  执行: 生成执行计划, 查看待确认计划, 查看执行日志, 定时任务
  辅助: 美化文档, 百度云同步

Execution module user-facing actions:
  - 'generate-plan': AI analyzes current note, extracts action items,
    creates PlanDraft (never auto-executes)
  - 'view-pending-plans': opens most recent plan draft
  - 'view-execution-logs': opens most recent execution record
  - 'scheduled-tasks': notice placeholder until v2.1

Icons migrated from emoji to Lucide (Obsidian-native):
  sparkles, book-open-check, message-circle-question, puzzle,
  scan-search, book-marked, activity, list-todo, clipboard-list,
  scroll-text, timer, paintbrush, cloud-upload

CommandPanelModal now uses setIcon() for proper SVG rendering.
Settings nav no longer uses emoji.
2026-05-20 16:50:26 +08:00
Yan
3720bdfbfe fix(2.0.0): address 5 blocking issues before merge
P0-1: create-plan-only no longer executes — uses new PlanDraftStore
      to persist plans under Knowledge/_ExecutionPlans/ without applying.
      PlanExecutor result is now checked for success/failure.

P0-2: Scheduler runtime disabled by default in v2.0 (commented out
      startScheduler call). Will be enabled via settings UI in v2.1.
      runBaiduBackup now checks cfg.autoBackup.
      Task renamed to '每日配置同步' to reflect actual behavior.

P1-1: Vault QA source links use [[path|title]] format for reliable
      resolution regardless of H1 vs filename mismatch.

P1-2: NextRunCalculator.getNextRun weekly bug fixed — same-day
      targets before due time now resolve to today, not next week.

P1-3: README execution section rewritten to match actual state.
      Settings page execution description updated accordingly.

P2-1: 'scheduler' added to PlanSource type.
P2-2: CI triggers on release/** branches.
P2-3: Command panel now renders AI 助手 as pinned entry above grouped actions.
2026-05-20 16:28:55 +08:00
Yan
7b26626ccb feat(2.0.0): three-module architecture — knowledge/execution/auxiliary
M1: README正式化 + badges + 三模块叙事 + 状态修正 + 版本对齐2.0.0
M2: 设置页改为侧边导航(知识/执行/辅助) + 分区布局CSS
M3: ActionDomain(knowledge/execution/auxiliary) 替代旧ActionGroup + 面板三栏
M4: Scheduler MVP — ScheduledTaskRunner + NextRunCalculator + 知识债务扫描 + 百度备份任务
    KnowledgeIndexService 新增 getAll() 公开方法
    KnowledgeDebtModal 改用公开API
2026-05-20 16:06:28 +08:00
Yan
cb4bd88c65 docs: bilingual README, PRIVACY, governance files 2026-05-20 15:17:57 +08:00
Yan
522bb86478 ci: add CI workflow, dependabot, npm ci, templates 2026-05-20 15:17:30 +08:00
Yan
a172f9d18a chore: strict mode, pin obsidian, bump v1.9.0 2026-05-20 15:17:24 +08:00
Yan
421f372c66 feat: concept completion, question graph, vault QA, debt dashboard actions 2026-05-20 15:17:16 +08:00
Yan
8f288069c5 refactor(ai): migrate all callers to core/llm 2026-05-20 15:17:10 +08:00
Yan
d97d6e72c4 feat(core): unified LLM client, knowledge index, execution plan infra 2026-05-20 15:17:01 +08:00
yan
04a1486ade release: 1.8.3 2026-05-17 01:15:31 +08:00
yan
6fba79cf99 release: 1.8.2 2026-05-17 01:07:32 +08:00
yan
cf4c5a3e65 release: 1.8.1 2026-05-17 01:01:58 +08:00
yan
fcc32e020a update readme file 2026-05-17 00:00:28 +08:00
yan
ff8b84e2df release: 1.8.0 2026-05-16 23:54:51 +08:00
yan
0e8af720ab release: 1.8.0 2026-05-16 23:48:46 +08:00
yan
68a5a92400 release: 1.7.8 2026-05-16 23:20:06 +08:00
yan
71441373f1 release: 1.7.7 2026-05-16 21:56:24 +08:00
yan
e3ea427bec release: 1.7.6 2026-05-08 14:04:00 +08:00
yan
552f76f302 release: 1.7.5 2026-05-08 13:05:57 +08:00
yan
79aa7df7a9 release: 1.7.4 2026-05-08 12:55:00 +08:00
yan
cc6f12e147 release: 1.7.3 2026-05-07 22:38:49 +08:00
yan
22fda29f01 release: 1.7.2 2026-05-07 22:11:41 +08:00
yan
bef0ecbc87 release: 1.7.1 2026-05-07 10:23:40 +08:00
yan
eee0ac32d0 release: 1.7.0 2026-05-07 09:44:40 +08:00
yan
f9d6582444 release: 1.6.1 2026-05-07 09:29:32 +08:00
yan
916b47d7b2 release: 1.6.0 2026-05-07 08:32:58 +08:00
yan
dbd5561bf9 release: 1.5.7 2026-05-02 08:37:16 +08:00
yan
967f558908 release: 1.5.6 2026-05-01 21:18:21 +08:00
yan
1be28a335a release: 1.5.5 2026-05-01 15:06:54 +08:00
yan
33bbe3d334 chore: bump version to 1.5.4 2026-05-01 15:04:45 +08:00
yan
a23c35901b chore: bump version to 1.5.3 2026-05-01 15:03:22 +08:00
yan
4f5b9c52f3 1.5.2
init shell
2026-04-30 01:11:01 +08:00
yan
12fddc359a chore: bump version to 1.5.2 2026-04-30 00:45:15 +08:00
yan
2031c55f29 chore: bump version to 1.5.1 2026-04-30 00:41:21 +08:00
yan
3300a9e629 chore: bump version to 1.5.0 2026-04-30 00:40:51 +08:00
yan
1e671ce419 init manifest 2026-04-29 10:56:46 +08:00
yan
33f91ff947 add baiduyun sync 2026-04-28 11:59:32 +08:00
yan
6387f29f2d init plugin readme for ob 2026-04-27 08:27:46 +08:00