Skip to content
miaoxiaoqianPublic

About

No description, website, or topics provided.

Resources

Stars

3 stars

Watchers

0 watching

Forks

Repository files navigation

Obsidogx

A local Obsidian plugin for creating a customizable floating pet that can chat, manage dashboard reminders, run local reading-analysis tools, and help build paper knowledge graphs.

Demo

If the video does not render in your GitHub client, open assets/demo.mov directly.

What's New In 0.1.1

  • Added built-in reading skills for paper knowledge graphs and reading-record analysis.
  • Added Agent tools and command palette actions for Create reading knowledge graph and Analyze reading records.
  • Made reading-log parsing generic across Chinese and English note formats.
  • Added clean release packaging with npm run package.
  • Added versions.json, built runtime files, and a macOS-only native desktop companion guard.

See CHANGELOG.md for details.

Features

  • Create multiple pets and switch between them.
  • Upload a pet cover asset and per-action PNG/JPG/WebP/GIF files or horizontal spritesheets.
  • Save multiple appearance templates per pet, expand each template to edit its unique info, and apply one to switch the pet's cover and idle appearance.
  • Automatically cut out simple static-image backgrounds during upload.
  • Define actions such as idle, wave, jump, think, sleep, shake, and custom.
  • For spritesheets, set assetType to spritesheet, then configure frameCount and frameDurationMs.
  • Keep the pet fixed and draggable, or optionally let it walk inside the Obsidian window.
  • Background handoff can show the same 2D pet as a transparent desktop window on macOS while Obsidian is in the background. Other platforms keep the in-window Obsidian pet.
  • Click the pet to open or close the Dashboard / Chat panel.
  • Mark dashboard rows from the pet panel. Markdown tasks are written back to their source file; Apex cards stay in dashboard.md and are marked complete.
  • Use Obsidian commands Create reading knowledge graph and Analyze reading records to run the local reading tools without opening pet chat.
  • Show fixed Dashboard tabs in the pet panel: Memo, Tasks, Study, and Learned.
  • Add Apex Memo, Task, and Study cards from the Dashboard panel; entries are written into the configured dashboard.md and refreshed immediately.
  • Memo rows show a short preview by default; click a memo to expand or collapse the full content with an inline animation.
  • Keep Apex Dashboard content synchronized with dashboard.md; completed rows disappear from the pet panel while the dashboard file keeps completed items marked.
  • Show deadline reminders on the pet when a dashboard/task due, deadline, or reminder value is approaching. Lead time, check interval, repeat interval, and default action are configurable.
  • Chat with a model API through OpenAI-compatible Chat Completions or OpenAI Responses.
  • Configure multiple model profiles and switch them from the Chat panel or settings.
  • Send chat messages with Enter; drag the divider in the chat panel to resize the message history area.
  • Send the active Markdown/text note, image, or PDF as optional chat context.
  • Keep bounded chat history with rolling or summarize-old-context strategies.
  • Optionally append completed chat exchanges to a Markdown log file.
  • Optional Agent mode lets the pet search/read notes, refresh pet content, show messages, and, with explicit write permission, create/append/overwrite notes or complete the current reminder.
  • Optional external Agent tools can open http/https browser links or prepare a WeChat draft after explicit settings permission and per-action confirmation.
  • Expose an API for other plugins to register content providers and action generators.

Interaction

  • Click the pet to show or hide the conversation menu.
  • Choose Dashboard or Chat from the outer menu.
  • In Dashboard, use the inner Memo, Tasks, Study, and Learned tabs to switch sections.
  • Choose Chat to open the pet chat panel. Chat no longer renders dashboard rows or dashboard add buttons under the messages, so the conversation area is only for conversation. Use Clear in More to erase the current persisted session history.
  • Tick a row checkbox to complete that item. Standard Markdown tasks become - [x]; Apex task rows become checked; Apex memo/learned cards stay in dashboard.md with done: true and strikethrough titles.
  • Selecting a dashboard row no longer opens dashboard.md immediately. Use the preview Open button when you want to jump to the source file.
  • Completing Apex Study moves the study card into ## Learned with a learned: date and source link.

Image Upload And Cutout

Auto cutout uploads is enabled by default. It converts static PNG, JPG, and WebP uploads to transparent PNGs by removing edge-connected background colors.

This works best for plain or simple backgrounds. GIFs are kept unchanged, and complex photos may still need a manually prepared transparent PNG.

Appearance Templates

In Pet -> Appearance templates, use Save current to store the active cover/idle asset as a reusable look. Each template is expandable and stores:

  • Name.
  • Unique description/info.
  • Asset path and asset type.

Apply switches the pet cover and idle action to that template. This lets one pet keep several 2D looks.

Low-Memory 2D Assets

This build is intentionally 2D-only to keep Obsidian memory low. GLB/GLTF uploads are rejected, and old model3d/.glb/.gltf configuration is ignored at render time instead of loading WebGL.

Recommended 2D asset requirements:

  • Format: PNG, JPG, WebP, GIF, or a horizontal spritesheet image.
  • Keep one character centered with transparent or simple background.
  • Prefer transparent PNG/WebP for static pets.
  • Keep assets small when possible; under 2 MB is a good target for Obsidian startup and panel performance.
  • For frame animation, use a horizontal spritesheet and set frameCount plus frameDurationMs.

Upload path:

  • Pet -> Cover asset -> Upload: sets the default pet body and syncs the idle action.
  • Actions -> Upload: sets a specific action asset.
  • Background handoff: reuses the same 2D asset or emoji fallback on macOS; it does not load Three.js or WebGL. On Windows, Linux, and mobile, the pet stays inside Obsidian.

Clean Release Packaging

Run this before publishing or sharing a manual-install build:

npm run package

The command rebuilds the plugin and writes a clean release folder to dist/obsidogx. It includes runtime files needed by Obsidian, including manifest.json, versions.json, main.js, styles.css, overlay-model.js, docs, and the optional macOS companion binary. It excludes local state such as data.json, chat history, generated pet assets, companion state files, and node_modules.

Built-In Content Sources

  • Apex Dashboard: reads the configured dashboard markdown file, usually dashboard.md, ensures ## Goal, ## Memo, ## Todo, ## Study, and ## Learned exist, and parses cards, tasks, due/deadline/reminder values, and learned review links.
  • Markdown tasks: unchecked tasks like - [ ] Write draft 📅 2026-06-08.
  • Markdown memos: notes under configured memo folders, or notes containing configured tags such as #memo or #备忘录.

Supported deadline syntax includes:

- [ ] Write draft 📅 2026-06-14
- [ ] Review slides due: 2026-06-14 09:00

## Todo
### Submit report
deadline: 2026-06-14 18:00

Content & reminders -> Deadline reminders controls whether the pet bubbles when the deadline is inside the lead window. The default lead is one week (10080 minutes). You can bind deadline-reminder to any action in Actions -> Action bindings.

Pet Chat

Enable Chat -> Enable chat, then configure:

  • Provider preset: OpenAI Chat Completions, OpenAI Responses, OpenRouter, DeepSeek, SiliconFlow, Moonshot, Ollama, LM Studio, or Custom.
  • API format: Chat Completions for OpenAI-compatible chat APIs; Responses when you want OpenAI Responses features such as PDF file context.
  • Endpoint, Model, and API key: fully editable even after choosing a preset.
  • Model profile: create multiple profiles for different providers or local models in settings. In the Chat panel, use the header dropdown to switch profiles.
  • System prompt: controls the pet's personality and answer style.
  • Max history messages and History strategy: either keep newest messages only, or summarize older messages into compact memory.

Chat history is stored per session in plugin data, capped by Max history messages, and can either roll over or summarize older context. Clear removes the current session context, but does not delete an optional Markdown chat log file.

The visible chat panel keeps model switching in the header, moves session/mode controls below the input, folds chat-specific actions into More, supports Enter to send, and includes a draggable message-history divider.

If Write chats to file is enabled, completed exchanges are appended to Chat log file such as Pet Chats.md or Logs/Pet Chats.md. Clearing chat history does not delete that file.

Active file context:

  • Markdown and text-like files are sent as clipped text.
  • Images are sent as vision input when Include active images is enabled.
  • PDFs are sent as file input only in Responses mode when Include active PDFs is enabled. In Chat Completions mode, the pet sends only a note that a PDF is active.
  • Attachment max bytes prevents large images or PDFs from being sent accidentally.

Agent mode:

  • Agent mode lets the model request one tool at a time using a JSON tool protocol.
  • Read/search tools include read_current_file, search_vault, read_note, list_pet_content, and refresh_pet_content.
  • Action/write tools include show_pet_message, create_note, append_note, overwrite_note, and complete_current_pet_content.
  • Reading tools include create_knowledge_graph and analyze_reading_records. They auto-discover a note named 阅读记录.md, Reading Log.md, or a note with reading-log frontmatter, then generate Markdown outputs such as 知识图谱.md and 阶段阅读分析.md.
  • Agent can write vault files must be enabled before write tools or completing current pet content can run.
  • Because reading tools create or overwrite Markdown files, they also require Agent can write vault files.
  • External tools include open_browser, open_web_search, and prepare_wechat_message. They are disabled by default under External actions.
  • open_browser only accepts http and https URLs.
  • prepare_wechat_message copies a draft to the clipboard and tries to open WeChat. It does not send the message automatically.
  • External actions has test buttons for browser search and WeChat draft preparation after the matching permission is enabled.
  • Agent max steps limits tool-call loops so the pet eventually answers.

Command palette:

  • Obsidogx: Create reading knowledge graph
  • Obsidogx: Analyze reading records

These commands use the same local reading tools as Agent mode, but they are explicit user commands, so they do not require chat, a model API, or Agent mode. Agent-triggered reading tools still require Agent can write vault files.

Reading graph examples:

创建知识图谱
分析阅读记录最近 8 篇
分析阅读记录 from 2026-06-01 to 2026-06-30

The built-in reading tools are local and deterministic. They do not require a web API, external scripts, or a fixed vault path. For best results, write each paper record with a ### [[Paper Title]] heading plus fields such as 方向, 任务, 创新点, and 相关算法或公式.

Skills

Skills are reusable instruction blocks injected into pet chat and Agent mode. They work like lightweight agent skills: each enabled skill adds a name, description, and instruction prompt to the model context.

Built-in reading skills teach Agent mode when to call local reading tools:

  • Reading Knowledge Graph: calls create_knowledge_graph when the user asks to build or refresh a paper knowledge graph.
  • Reading Log Analyst: calls analyze_reading_records when the user asks for reading direction analysis, stage analysis, gaps, or next reading suggestions.

In Skills settings:

  • Add skill: create a local DIY skill and edit its name, description, and prompt directly.
  • Restore built-ins: restore the built-in Obsidian skills without deleting custom skills.
  • Import from GitHub or raw URL: download skills from a GitHub repository, GitHub folder, GitHub file, raw SKILL.md, skill.json, or skills.json.

GitHub import supports these URL shapes:

https://github.com/user/repo
https://github.com/user/repo/tree/main/skills
https://github.com/user/repo/blob/main/skills/review/SKILL.md
https://raw.githubusercontent.com/user/repo/main/skills/review/SKILL.md

For repository or folder URLs, the plugin scans a limited depth for SKILL.md, skill.json, and skills.json, including layouts such as skills/review/SKILL.md.

SKILL.md format:

---
name: Review Coach
description: Create active-recall review prompts from notes and Learned dashboard items.
---

# Review Coach

When reviewing material, produce short active-recall questions, answers, and a next review suggestion. Prefer links back to useful notes.

skill.json format:

{
  "id": "review-coach",
  "name": "Review Coach",
  "description": "Create review prompts from notes.",
  "prompt": "Use active recall, short answers, and link back to relevant notes."
}

skills.json can contain multiple skills:

{
  "skills": [
    {
      "id": "dashboard-reviewer",
      "name": "Dashboard Reviewer",
      "description": "Review Goal, Todo, Study, and Learned.",
      "prompt": "Keep dashboard sections separate and suggest the next action."
    }
  ]
}

Action Logic

  • Cover asset is the default pet appearance and is also used by the idle action unless that action has its own asset.
  • Each action can use its own uploaded image, GIF, WebP, or horizontal spritesheet.
  • Actions -> DIY action slots is the manual upload interface. Use Add, set a stable lowercase Action id, upload a 2D asset, set playback options, then Preview.
  • motion adds CSS movement such as wave, jump, think, sleep, shake, or spin.
  • Spritesheets use frameCount and frameDurationMs to animate frames from left to right.
  • Generated actions can return an existing assetPath or inline image data such as assetDataUrl / assetBase64.
  • Action bindings can play actions automatically on user messages, assistant replies, agent tool calls, completed content, or deadline reminders. Keyword patterns are comma-separated.

Public API

Other plugins can access the API after this plugin loads:

const plugin = app.plugins.plugins["obsidogx"];
const api = plugin?.api;

api?.showMessage("Time to stretch.", {
  sourceName: "Reminder",
  actionId: "wave",
  timeoutMs: 3000
});

await api?.chat("Summarize the file I am looking at.");
api?.clearChatHistory();

Register a content provider:

const unregister = api.registerContentProvider({
  id: "my-reminders",
  name: "My Reminders",
  async getItems(context) {
    return [
      {
        id: "reminder-1",
        sourceId: "my-reminders",
        sourceName: "Reminders",
        title: "Review today's notes",
        priority: "normal"
      }
    ];
  }
});

Register an action generator:

api.registerActionGenerator({
  id: "my-generator",
  name: "My Generator",
  async generate(input, context) {
    return [
      {
        id: "wave",
        name: "Wave",
        motion: "wave",
        assetPath: input.coverAssetPath,
        assetType: "image",
        loop: true,
        createdAt: Date.now(),
        updatedAt: Date.now()
      }
    ];
  }
});

The built-in Custom HTTP action generator posts this JSON to your endpoint:

{
  "pet": {},
  "coverAssetPath": ".obsidian/plugins/obsidogx/pets/pet-id/cover.png",
  "requestedActions": ["idle", "wave", "jump"],
  "stylePrompt": "Small Obsidian desktop pet..."
}

Return either existing vault paths or generated image payloads:

{
  "actions": [
    {
      "id": "wave",
      "name": "Wave",
      "motion": "wave",
      "assetDataUrl": "data:image/png;base64,...",
      "loop": true
    }
  ]
}

Supported generated asset fields are assetPath, assetDataUrl, assetBase64, assetMimeType, assetFileName, frameCount, and frameDurationMs.

The plugin also dispatches a browser event when the API is ready:

window.addEventListener("obsidogx:api-ready", (event) => {
  const api = event.detail;
});

Recent Additions

  • Settings are grouped into collapsible sections: General, Pet, Actions, Content & reminders, Chat & Agent, Skills, Generation, and External actions.
  • Skills can be added manually or imported from GitHub/raw SKILL.md, skill.json, and skills.json; repo and folder imports scan for multiple skill files.
  • Pet appearance templates can store multiple looks per pet and apply a saved look to the cover/idle action.
  • Agent external actions support browser opening and WeChat draft preparation with explicit permission and confirmation.
  • Dashboard/task deadline reminders can pop a pet bubble before due, deadline, or reminder times.
  • Chat panel controls now switch session, Chat/Agent mode, provider preset, and model in place.
  • Chat history is stored per session with bounded history, summary memory, clearing, and optional Markdown logging.
  • Pet Profile fields are injected into chat, so self-introduction can use the configured background, personality, abilities, preferences, catchphrases, and preferred intro.
  • Agent mode supports web_search when enabled, with DuckDuckGo HTML, Brave, Tavily, SerpAPI, or Custom JSON providers.
  • Apex Dashboard now reads ## Goal, ## Study, and ## Learned in addition to Memo/Todo.
  • The pet panel now has a two-level UI: outer Dashboard / Chat, then Dashboard tabs for Memo / Tasks / Study / Learned.
  • Chat mode is chat-only and no longer places dashboard modules below or over the message history.
  • Completing an Apex Study card or Study task moves the study card to ## Learned with a source link.
  • Action settings now focus on manual DIY action slots: edit action ids, upload 2D assets/spritesheets, preview them, and bind them to messages, Agent tools, completions, or reminders.
  • This low-memory build disables GLB/GLTF rendering and removes the Three.js runtime path.
  • Background handoff has a click-to-toggle bubble for the current reminder and dashboard module summary while Obsidian is in the background.

About

No description, website, or topics provided.

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages