@mseep/obsidian-agent-client 0.10.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (146) hide show
  1. package/.claude/hooks/gh-setup.sh +49 -0
  2. package/.claude/settings.json +15 -0
  3. package/.claude/skills/release-notes/SKILL.md +331 -0
  4. package/.editorconfig +10 -0
  5. package/.github/FUNDING.yml +2 -0
  6. package/.github/ISSUE_TEMPLATE/bug_report.yml +90 -0
  7. package/.github/ISSUE_TEMPLATE/config.yml +11 -0
  8. package/.github/ISSUE_TEMPLATE/feature_request.yml +59 -0
  9. package/.github/copilot-instructions.md +45 -0
  10. package/.github/pull_request_template.md +32 -0
  11. package/.github/workflows/ci.yaml +25 -0
  12. package/.github/workflows/docs.yml +58 -0
  13. package/.github/workflows/relay_to_openclaw.yml +59 -0
  14. package/.github/workflows/release.yaml +45 -0
  15. package/.prettierignore +10 -0
  16. package/.prettierrc +13 -0
  17. package/.vscode/extensions.json +7 -0
  18. package/.vscode/settings.json +37 -0
  19. package/.zed/settings.json +42 -0
  20. package/AGENTS.md +330 -0
  21. package/ARCHITECTURE.md +390 -0
  22. package/CONTRIBUTING.md +216 -0
  23. package/LICENSE +202 -0
  24. package/NOTICE +2 -0
  25. package/README.ja.md +121 -0
  26. package/README.md +125 -0
  27. package/docs/.vitepress/config.mts +124 -0
  28. package/docs/.vitepress/theme/custom.css +111 -0
  29. package/docs/.vitepress/theme/index.ts +4 -0
  30. package/docs/agent-setup/claude-code.md +84 -0
  31. package/docs/agent-setup/codex.md +76 -0
  32. package/docs/agent-setup/custom-agents.md +67 -0
  33. package/docs/agent-setup/gemini-cli.md +99 -0
  34. package/docs/agent-setup/index.md +34 -0
  35. package/docs/announcements/gemini-cli-deprecation.md +73 -0
  36. package/docs/getting-started/index.md +78 -0
  37. package/docs/getting-started/quick-start.md +38 -0
  38. package/docs/help/faq.md +181 -0
  39. package/docs/help/troubleshooting.md +221 -0
  40. package/docs/index.md +63 -0
  41. package/docs/public/apple-touch-icon.png +0 -0
  42. package/docs/public/demo.mp4 +0 -0
  43. package/docs/public/favicon-16x16.png +0 -0
  44. package/docs/public/favicon-32x32.png +0 -0
  45. package/docs/public/favicon.ico +0 -0
  46. package/docs/public/images/editing.webp +0 -0
  47. package/docs/public/images/export.webp +0 -0
  48. package/docs/public/images/floating-chat-button.webp +0 -0
  49. package/docs/public/images/floating-chat-instance-menu.webp +0 -0
  50. package/docs/public/images/floating-chat-view.webp +0 -0
  51. package/docs/public/images/mode-selection.webp +0 -0
  52. package/docs/public/images/model-selection.webp +0 -0
  53. package/docs/public/images/multi-session.webp +0 -0
  54. package/docs/public/images/remove-image.webp +0 -0
  55. package/docs/public/images/ribbon-icon.webp +0 -0
  56. package/docs/public/images/selection-context.gif +0 -0
  57. package/docs/public/images/sending-images.webp +0 -0
  58. package/docs/public/images/sending-messages.webp +0 -0
  59. package/docs/public/images/session-history-button.webp +0 -0
  60. package/docs/public/images/slash-commands-1.webp +0 -0
  61. package/docs/public/images/slash-commands-2.webp +0 -0
  62. package/docs/public/images/switch-agent.webp +0 -0
  63. package/docs/public/images/switch-default-agent.webp +0 -0
  64. package/docs/public/images/temporary-disable.gif +0 -0
  65. package/docs/reference/acp-support.md +110 -0
  66. package/docs/usage/chat-export.md +80 -0
  67. package/docs/usage/commands.md +51 -0
  68. package/docs/usage/context-files.md +57 -0
  69. package/docs/usage/editing.md +69 -0
  70. package/docs/usage/floating-chat.md +84 -0
  71. package/docs/usage/index.md +97 -0
  72. package/docs/usage/mcp-tools.md +33 -0
  73. package/docs/usage/mentions.md +70 -0
  74. package/docs/usage/mode-selection.md +28 -0
  75. package/docs/usage/model-selection.md +32 -0
  76. package/docs/usage/multi-session.md +68 -0
  77. package/docs/usage/sending-images.md +64 -0
  78. package/docs/usage/session-history.md +91 -0
  79. package/docs/usage/slash-commands.md +44 -0
  80. package/esbuild.config.mjs +49 -0
  81. package/eslint.config.mjs +25 -0
  82. package/main.js +228 -0
  83. package/manifest.json +11 -0
  84. package/package.json +52 -0
  85. package/src/acp/acp-client.ts +921 -0
  86. package/src/acp/acp-handler.ts +252 -0
  87. package/src/acp/permission-handler.ts +282 -0
  88. package/src/acp/terminal-handler.ts +264 -0
  89. package/src/acp/type-converter.ts +272 -0
  90. package/src/hooks/useAgent.ts +250 -0
  91. package/src/hooks/useAgentMessages.ts +470 -0
  92. package/src/hooks/useAgentSession.ts +544 -0
  93. package/src/hooks/useChatActions.ts +400 -0
  94. package/src/hooks/useHistoryModal.ts +219 -0
  95. package/src/hooks/useSessionHistory.ts +863 -0
  96. package/src/hooks/useSettings.ts +19 -0
  97. package/src/hooks/useSuggestions.ts +342 -0
  98. package/src/main.ts +9 -0
  99. package/src/plugin.ts +1126 -0
  100. package/src/services/chat-exporter.ts +552 -0
  101. package/src/services/message-sender.ts +755 -0
  102. package/src/services/message-state.ts +375 -0
  103. package/src/services/session-helpers.ts +211 -0
  104. package/src/services/session-state.ts +130 -0
  105. package/src/services/session-storage.ts +267 -0
  106. package/src/services/settings-normalizer.ts +255 -0
  107. package/src/services/settings-service.ts +285 -0
  108. package/src/services/update-checker.ts +128 -0
  109. package/src/services/vault-service.ts +558 -0
  110. package/src/services/view-registry.ts +345 -0
  111. package/src/types/agent.ts +92 -0
  112. package/src/types/chat.ts +351 -0
  113. package/src/types/errors.ts +136 -0
  114. package/src/types/obsidian-internals.d.ts +14 -0
  115. package/src/types/session.ts +731 -0
  116. package/src/ui/ChangeDirectoryModal.ts +137 -0
  117. package/src/ui/ChatContext.ts +25 -0
  118. package/src/ui/ChatHeader.tsx +295 -0
  119. package/src/ui/ChatPanel.tsx +1162 -0
  120. package/src/ui/ChatView.tsx +348 -0
  121. package/src/ui/ErrorBanner.tsx +104 -0
  122. package/src/ui/FloatingButton.tsx +351 -0
  123. package/src/ui/FloatingChatView.tsx +531 -0
  124. package/src/ui/InputArea.tsx +1107 -0
  125. package/src/ui/InputToolbar.tsx +371 -0
  126. package/src/ui/MessageBubble.tsx +442 -0
  127. package/src/ui/MessageList.tsx +265 -0
  128. package/src/ui/PermissionBanner.tsx +61 -0
  129. package/src/ui/SessionHistoryModal.tsx +821 -0
  130. package/src/ui/SettingsTab.ts +1337 -0
  131. package/src/ui/SuggestionPopup.tsx +138 -0
  132. package/src/ui/TerminalBlock.tsx +107 -0
  133. package/src/ui/ToolCallBlock.tsx +456 -0
  134. package/src/ui/shared/AttachmentStrip.tsx +57 -0
  135. package/src/ui/shared/IconButton.tsx +55 -0
  136. package/src/ui/shared/MarkdownRenderer.tsx +103 -0
  137. package/src/ui/view-host.ts +56 -0
  138. package/src/utils/error-utils.ts +274 -0
  139. package/src/utils/logger.ts +44 -0
  140. package/src/utils/mention-parser.ts +129 -0
  141. package/src/utils/paths.ts +246 -0
  142. package/src/utils/platform.ts +425 -0
  143. package/styles.css +2322 -0
  144. package/tsconfig.json +18 -0
  145. package/version-bump.mjs +18 -0
  146. package/versions.json +3 -0
@@ -0,0 +1,64 @@
1
+ # Sending Images and Files
2
+
3
+ Attach images and files to your messages to provide context to the AI agent.
4
+
5
+ ## Attaching Files
6
+
7
+ ### Drag and Drop
8
+
9
+ 1. Drag files from Finder/Explorer onto the input area
10
+ 2. The input area highlights when you drag over it
11
+ 3. Thumbnails (images) or file icons (other files) appear below the text area
12
+
13
+ ### Paste from Clipboard
14
+
15
+ 1. Copy a file or image to your clipboard
16
+ 2. Focus the input field
17
+ 3. Paste with `Cmd/Ctrl + V`
18
+
19
+ <p align="center">
20
+ <img src="/images/sending-images.webp" alt="Sending Images and Files" width="400" />
21
+ </p>
22
+
23
+ ::: tip
24
+ Embedding images in messages requires agent support. If the agent doesn't support images, image files are sent as file references instead (via drag and drop or paste from Finder/Explorer).
25
+ :::
26
+
27
+ ## Managing Attachments
28
+
29
+ Attached files appear as thumbnails or file icons below the text area.
30
+
31
+ - **Remove an attachment**: Hover over it and click the **×** button
32
+ - **Attachments are sent with your message**: When you send, all attached files are included
33
+
34
+ <p align="center">
35
+ <img src="/images/remove-image.webp" alt="Remove attachment button" width="400" />
36
+ </p>
37
+
38
+ ## Supported Image Formats
39
+
40
+ | Format | MIME Type |
41
+ |--------|-----------|
42
+ | PNG | `image/png` |
43
+ | JPEG | `image/jpeg` |
44
+ | GIF | `image/gif` |
45
+ | WebP | `image/webp` |
46
+
47
+ Non-image files have no format restriction.
48
+
49
+ ::: info
50
+ Non-image files are sent as file path references. How the agent processes the file depends on its capabilities and available tools.
51
+ :::
52
+
53
+ ## Limits
54
+
55
+ | Limit | Value |
56
+ |-------|-------|
57
+ | Maximum image size | 5 MB per image |
58
+ | Maximum attachments | 10 per message (images + files combined) |
59
+
60
+ ::: info
61
+ If you exceed these limits, a notification will inform you:
62
+ - `[Agent Client] Image too large (max 5MB)`
63
+ - `[Agent Client] Maximum 10 attachments allowed`
64
+ :::
@@ -0,0 +1,91 @@
1
+ # Session History
2
+
3
+ Resume previous conversations or branch off from past sessions.
4
+
5
+ ## Agent Support
6
+
7
+ Session history features are agent-specific. Not all agents support all features.
8
+
9
+ ## Opening Session History
10
+
11
+ Click the **History** button (clock icon) in the chat header to open the session history modal.
12
+
13
+ <p align="center">
14
+ <img src="/images/session-history-button.webp" alt="Session history button in chat header" />
15
+ </p>
16
+
17
+ ## Available Actions
18
+
19
+ Depending on the agent's capabilities, you can perform the following actions:
20
+
21
+ | Action | Description |
22
+ |--------|-------------|
23
+ | **Edit title** | Rename the session from the history modal |
24
+ | **Restore** | Resume the session where you left off |
25
+ | **Fork** | Create a new branch from that point in the conversation |
26
+ | **Delete** | Remove the session from history |
27
+
28
+ ::: tip
29
+ Not all actions are available for every agent. The modal shows only the actions supported by your current agent.
30
+ :::
31
+
32
+ ## Session Storage
33
+
34
+ Sessions are saved automatically when you send messages. The plugin stores:
35
+
36
+ - **Session metadata**: Title (derived from your first message), timestamps, and working directory
37
+ - **Message history**: Full conversation including agent responses, tool calls, and plans
38
+
39
+ ### Where Sessions Are Stored
40
+
41
+ Sessions are saved in two places:
42
+
43
+ - **Plugin side**: Stored locally in Obsidian's data folder
44
+ - **Agent side**: Managed by the agent
45
+
46
+ ## Restore vs Fork
47
+
48
+ ### Restore
49
+
50
+ Restoring a session continues the existing conversation:
51
+
52
+ 1. The agent reconnects to the previous session
53
+ 2. Your conversation history is displayed
54
+ 3. New messages continue the same session
55
+
56
+ Use restore when you want to **continue where you left off**.
57
+
58
+ ### Fork
59
+
60
+ Forking creates a new session branching from a previous point:
61
+
62
+ 1. A new session is created with a copy of the conversation up to that point
63
+ 2. The original session remains unchanged
64
+ 3. New messages go to the forked session
65
+
66
+ Use fork when you want to **explore a different direction** without affecting the original conversation.
67
+
68
+ ## Deleting Sessions
69
+
70
+ To delete a session:
71
+
72
+ 1. Click the **Delete** button (trash icon) on the session
73
+ 2. Confirm the deletion in the dialog
74
+
75
+ ::: warning
76
+ Deletion removes the session from the plugin's local storage only. The session still exists on the agent side.
77
+ :::
78
+
79
+ ## Troubleshooting
80
+
81
+ ### "This agent does not support session restoration"
82
+
83
+ The current agent doesn't provide session restore/fork capabilities. You can still view and delete locally saved sessions.
84
+
85
+ ### "Preparing agent..."
86
+
87
+ The agent is still initializing. Wait a moment for the agent to become ready.
88
+
89
+ ### "No previous sessions"
90
+
91
+ No sessions have been saved yet for the current agent and vault. Start a new conversation to create your first session.
@@ -0,0 +1,44 @@
1
+ # Slash Commands
2
+
3
+ Use slash commands to trigger actions provided by your current agent.
4
+
5
+ ## Agent Support
6
+
7
+ Slash commands are agent-specific. Not all agents support slash commands.
8
+
9
+ ::: tip
10
+ If the input field placeholder shows `/ for commands`, the current agent supports slash commands. If not, the agent does not support this feature.
11
+ :::
12
+
13
+ ## Using Slash Commands
14
+
15
+ 1. Type `/` in the input field
16
+ 2. A dropdown appears showing available commands
17
+ 3. Select a command or continue typing to filter
18
+ 4. Press `Enter` to execute the command
19
+
20
+ <p align="center">
21
+ <img src="/images/slash-commands-1.webp" alt="Slash commands dropdown" width="400" />
22
+ </p>
23
+
24
+ <p align="center">
25
+ <img src="/images/slash-commands-2.webp" alt="Filtering slash commands" width="400" />
26
+ </p>
27
+
28
+ ## Available Commands
29
+
30
+ Available commands are determined entirely by the agent—not by this plugin. Each agent provides its own set of commands.
31
+
32
+ For example, Claude Code offers commands like `/compact`, `/init`, and `/review`, while other agents may have completely different commands or none at all.
33
+
34
+ Refer to your agent's documentation for a full list of supported commands.
35
+
36
+ ## Command Arguments
37
+
38
+ Some commands accept arguments:
39
+
40
+ ```
41
+ /command keyword
42
+ ```
43
+
44
+ Type the command followed by a space and your arguments.
@@ -0,0 +1,49 @@
1
+ import esbuild from "esbuild";
2
+ import process from "process";
3
+ import { builtinModules } from "node:module";
4
+
5
+ const banner = `/*
6
+ THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
7
+ if you want to view the source, please visit the github repository of this plugin
8
+ */
9
+ `;
10
+
11
+ const prod = process.argv[2] === "production";
12
+
13
+ const context = await esbuild.context({
14
+ banner: {
15
+ js: banner,
16
+ },
17
+ entryPoints: ["src/main.ts"],
18
+ bundle: true,
19
+ external: [
20
+ "obsidian",
21
+ "electron",
22
+ "@codemirror/autocomplete",
23
+ "@codemirror/collab",
24
+ "@codemirror/commands",
25
+ "@codemirror/language",
26
+ "@codemirror/lint",
27
+ "@codemirror/search",
28
+ "@codemirror/state",
29
+ "@codemirror/view",
30
+ "@lezer/common",
31
+ "@lezer/highlight",
32
+ "@lezer/lr",
33
+ ...builtinModules,
34
+ ],
35
+ format: "cjs",
36
+ target: "es2018",
37
+ logLevel: "info",
38
+ sourcemap: prod ? false : "inline",
39
+ treeShaking: true,
40
+ outfile: "main.js",
41
+ minify: prod,
42
+ });
43
+
44
+ if (prod) {
45
+ await context.rebuild();
46
+ process.exit(0);
47
+ } else {
48
+ await context.watch();
49
+ }
@@ -0,0 +1,25 @@
1
+ import tsparser from "@typescript-eslint/parser";
2
+ import { defineConfig } from "eslint/config";
3
+ import obsidianmd from "eslint-plugin-obsidianmd";
4
+ import tseslint from "typescript-eslint";
5
+
6
+ export default defineConfig([
7
+ {
8
+ ignores: ["node_modules/", "main.js", "docs/"],
9
+ },
10
+ ...obsidianmd.configs.recommended,
11
+ ...tseslint.configs.recommended,
12
+ {
13
+ files: ["**/*.ts", "**/*.tsx"],
14
+ languageOptions: {
15
+ parser: tsparser,
16
+ parserOptions: { project: "./tsconfig.json" },
17
+ },
18
+ rules: {
19
+ // Preserve existing rules
20
+ "@typescript-eslint/no-unused-vars": ["error", { args: "none" }],
21
+ "@typescript-eslint/ban-ts-comment": "off",
22
+ "@typescript-eslint/no-empty-function": "off",
23
+ },
24
+ },
25
+ ]);