opensidian 1.0.0
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.
- package/.eslintrc.json +1 -0
- package/.github/ISSUE_TEMPLATE/bug_report.md +49 -0
- package/.github/ISSUE_TEMPLATE/feature_request.md +35 -0
- package/.github/ISSUE_TEMPLATE/question.md +23 -0
- package/.github/PULL_REQUEST_TEMPLATE.md +45 -0
- package/.github/README.md +5 -0
- package/.github/workflows/cd.yml +44 -0
- package/.github/workflows/ci.yml +128 -0
- package/.github/workflows/qa.yml +45 -0
- package/.planning/PROJECT.md +96 -0
- package/.planning/REQUIREMENTS.md +66 -0
- package/.planning/ROADMAP.md +129 -0
- package/.planning/STATE.md +47 -0
- package/.planning/config.json +14 -0
- package/CONTRIBUTING.md +232 -0
- package/LICENSE +21 -0
- package/README.md +244 -0
- package/dist/api/auth.d.ts +5 -0
- package/dist/api/auth.d.ts.map +1 -0
- package/dist/api/auth.js +112 -0
- package/dist/api/auth.js.map +1 -0
- package/dist/api/routes.d.ts +3 -0
- package/dist/api/routes.d.ts.map +1 -0
- package/dist/api/routes.js +119 -0
- package/dist/api/routes.js.map +1 -0
- package/dist/api/themes.d.ts +3 -0
- package/dist/api/themes.d.ts.map +1 -0
- package/dist/api/themes.js +48 -0
- package/dist/api/themes.js.map +1 -0
- package/dist/core/graph.d.ts +16 -0
- package/dist/core/graph.d.ts.map +1 -0
- package/dist/core/graph.js +115 -0
- package/dist/core/graph.js.map +1 -0
- package/dist/core/markdown.d.ts +21 -0
- package/dist/core/markdown.d.ts.map +1 -0
- package/dist/core/markdown.js +77 -0
- package/dist/core/markdown.js.map +1 -0
- package/dist/core/search.d.ts +34 -0
- package/dist/core/search.d.ts.map +1 -0
- package/dist/core/search.js +159 -0
- package/dist/core/search.js.map +1 -0
- package/dist/core/sync.d.ts +30 -0
- package/dist/core/sync.d.ts.map +1 -0
- package/dist/core/sync.js +121 -0
- package/dist/core/sync.js.map +1 -0
- package/dist/core/vault.d.ts +28 -0
- package/dist/core/vault.d.ts.map +1 -0
- package/dist/core/vault.js +235 -0
- package/dist/core/vault.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +32 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp/cli.d.ts +3 -0
- package/dist/mcp/cli.d.ts.map +1 -0
- package/dist/mcp/cli.js +7 -0
- package/dist/mcp/cli.js.map +1 -0
- package/dist/mcp/server.d.ts +18 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +272 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/plugins/host.d.ts +23 -0
- package/dist/plugins/host.d.ts.map +1 -0
- package/dist/plugins/host.js +104 -0
- package/dist/plugins/host.js.map +1 -0
- package/dist/plugins/sample-plugin.d.ts +10 -0
- package/dist/plugins/sample-plugin.d.ts.map +1 -0
- package/dist/plugins/sample-plugin.js +23 -0
- package/dist/plugins/sample-plugin.js.map +1 -0
- package/dist/server.d.ts +15 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +77 -0
- package/dist/server.js.map +1 -0
- package/dist/shared/types.d.ts +86 -0
- package/dist/shared/types.d.ts.map +1 -0
- package/dist/shared/types.js +2 -0
- package/dist/shared/types.js.map +1 -0
- package/docker/Dockerfile +37 -0
- package/docker/docker-compose.yml +46 -0
- package/docs/ARCHITECTURE.md +321 -0
- package/futuras_implementacoes.md +0 -0
- package/package.json +65 -0
- package/scripts/fix-gitignore.ps1 +5 -0
- package/scripts/seed-notes.mjs +60 -0
- package/src/api/auth.ts +130 -0
- package/src/api/routes.ts +133 -0
- package/src/api/themes.ts +60 -0
- package/src/core/graph.ts +145 -0
- package/src/core/markdown.ts +92 -0
- package/src/core/search.ts +208 -0
- package/src/core/sync.ts +157 -0
- package/src/core/vault.ts +286 -0
- package/src/index.ts +37 -0
- package/src/mcp/cli.ts +7 -0
- package/src/mcp/server.ts +296 -0
- package/src/plugins/host.ts +120 -0
- package/src/plugins/sample-plugin.ts +29 -0
- package/src/server.ts +90 -0
- package/src/shared/types.ts +92 -0
- package/tests/api/routes.test.ts +167 -0
- package/tests/core/graph.test.ts +236 -0
- package/tests/core/markdown.test.ts +157 -0
- package/tests/core/search.test.ts +132 -0
- package/tests/core/sync.test.ts +62 -0
- package/tests/core/vault.test.ts +162 -0
- package/tests/mcp/server.test.ts +118 -0
- package/tests/plugins/host.test.ts +165 -0
- package/tests/plugins/sample-plugin.test.ts +35 -0
- package/tests/server.test.ts +76 -0
- package/tsconfig.json +27 -0
- package/vite.config.ts +27 -0
- package/vitest.config.ts +33 -0
- package/web/index.html +13 -0
- package/web/package.json +26 -0
- package/web/public/favicon.svg +4 -0
- package/web/src/App.tsx +63 -0
- package/web/src/api/auth.ts +65 -0
- package/web/src/api/client.ts +117 -0
- package/web/src/api/themes.ts +78 -0
- package/web/src/components/GraphView.tsx +139 -0
- package/web/src/components/Layout.tsx +74 -0
- package/web/src/components/LoginPage.tsx +52 -0
- package/web/src/components/NoteEditor.tsx +114 -0
- package/web/src/components/NoteList.tsx +95 -0
- package/web/src/components/RegisterPage.tsx +58 -0
- package/web/src/components/SearchBar.tsx +71 -0
- package/web/src/components/SearchPanel.tsx +152 -0
- package/web/src/components/ThemeEditor.tsx +129 -0
- package/web/src/components/ThemeSelector.tsx +41 -0
- package/web/src/components/VaultList.tsx +89 -0
- package/web/src/hooks/AuthContext.tsx +57 -0
- package/web/src/hooks/ThemeContext.tsx +77 -0
- package/web/src/hooks/useWebSocket.ts +34 -0
- package/web/src/main.tsx +10 -0
- package/web/src/styles/global.css +449 -0
- package/web/tsconfig.json +21 -0
- package/web/vite.config.ts +19 -0
package/.eslintrc.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.eslintrc.json
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
name: Bug Report
|
|
2
|
+
|
|
3
|
+
about: Create a report to help us improve
|
|
4
|
+
|
|
5
|
+
title: '[BUG] '
|
|
6
|
+
|
|
7
|
+
labels: ['bug']
|
|
8
|
+
|
|
9
|
+
assignees: ''
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Description
|
|
14
|
+
|
|
15
|
+
<!-- A clear description of the bug -->
|
|
16
|
+
|
|
17
|
+
## Steps to Reproduce
|
|
18
|
+
|
|
19
|
+
<!-- Steps to reproduce the behavior -->
|
|
20
|
+
|
|
21
|
+
1.
|
|
22
|
+
2.
|
|
23
|
+
3.
|
|
24
|
+
|
|
25
|
+
## Expected Behavior
|
|
26
|
+
|
|
27
|
+
<!-- What you expected to happen -->
|
|
28
|
+
|
|
29
|
+
## Actual Behavior
|
|
30
|
+
|
|
31
|
+
<!-- What actually happened -->
|
|
32
|
+
|
|
33
|
+
## Screenshots
|
|
34
|
+
|
|
35
|
+
<!-- If applicable, add screenshots to help explain your problem -->
|
|
36
|
+
|
|
37
|
+
## Environment
|
|
38
|
+
|
|
39
|
+
- OS: [e.g., Windows 11, macOS 14, Ubuntu 22.04]
|
|
40
|
+
- Node.js version:
|
|
41
|
+
- OpenSidian version:
|
|
42
|
+
|
|
43
|
+
## Additional Context
|
|
44
|
+
|
|
45
|
+
<!-- Add any other context about the problem here -->
|
|
46
|
+
|
|
47
|
+
## Related Issues
|
|
48
|
+
|
|
49
|
+
<!-- Link any related issues -->
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
name: Feature Request
|
|
2
|
+
|
|
3
|
+
about: Suggest a new feature for OpenSidian
|
|
4
|
+
|
|
5
|
+
title: '[FEATURE] '
|
|
6
|
+
|
|
7
|
+
labels: ['enhancement']
|
|
8
|
+
|
|
9
|
+
assignees: ''
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Problem Statement
|
|
14
|
+
|
|
15
|
+
<!-- Describe the problem this feature solves -->
|
|
16
|
+
|
|
17
|
+
## Proposed Solution
|
|
18
|
+
|
|
19
|
+
<!-- Describe your proposed solution -->
|
|
20
|
+
|
|
21
|
+
## Alternatives Considered
|
|
22
|
+
|
|
23
|
+
<!-- Describe any alternative solutions you've considered -->
|
|
24
|
+
|
|
25
|
+
## Use Cases
|
|
26
|
+
|
|
27
|
+
<!-- List specific use cases for this feature -->
|
|
28
|
+
|
|
29
|
+
## Additional Context
|
|
30
|
+
|
|
31
|
+
<!-- Add any other context or screenshots about the feature request -->
|
|
32
|
+
|
|
33
|
+
## Related Issues
|
|
34
|
+
|
|
35
|
+
<!-- Link any related issues -->
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
name: Question
|
|
2
|
+
|
|
3
|
+
about: Ask a question about OpenSidian
|
|
4
|
+
|
|
5
|
+
title: '[QUESTION] '
|
|
6
|
+
|
|
7
|
+
labels: ['question']
|
|
8
|
+
|
|
9
|
+
assignees: ''
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Question
|
|
14
|
+
|
|
15
|
+
<!-- Your question -->
|
|
16
|
+
|
|
17
|
+
## Context
|
|
18
|
+
|
|
19
|
+
<!-- Additional context -->
|
|
20
|
+
|
|
21
|
+
## Related Issues
|
|
22
|
+
|
|
23
|
+
<!-- Link any related issues -->
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
name: Pull Request
|
|
2
|
+
|
|
3
|
+
about: Submit changes to the OpenSidian project
|
|
4
|
+
|
|
5
|
+
title: '[PR] '
|
|
6
|
+
|
|
7
|
+
labels: ''
|
|
8
|
+
|
|
9
|
+
assignees: ''
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Description
|
|
14
|
+
|
|
15
|
+
<!-- Describe your changes -->
|
|
16
|
+
|
|
17
|
+
## Type of Change
|
|
18
|
+
|
|
19
|
+
<!-- Please delete options that are not relevant -->
|
|
20
|
+
|
|
21
|
+
- [ ] Bug fix (non-breaking change which fixes an issue)
|
|
22
|
+
- [ ] New feature (non-breaking change which adds functionality)
|
|
23
|
+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
|
|
24
|
+
- [ ] Documentation update
|
|
25
|
+
|
|
26
|
+
## Checklist
|
|
27
|
+
|
|
28
|
+
<!-- Please make sure all items are checked -->
|
|
29
|
+
|
|
30
|
+
- [ ] My code follows the style guidelines of this project
|
|
31
|
+
- [ ] I have performed a self-review of my code
|
|
32
|
+
- [ ] I have commented my code, particularly in hard-to-understand areas
|
|
33
|
+
- [ ] I have made corresponding changes to the documentation
|
|
34
|
+
- [ ] My changes generate no new warnings
|
|
35
|
+
- [ ] I have added tests that prove my fix is effective or that my feature works
|
|
36
|
+
- [ ] New and existing unit tests pass locally with my changes
|
|
37
|
+
- [ ] Any dependent changes have been merged
|
|
38
|
+
|
|
39
|
+
## Related Issues
|
|
40
|
+
|
|
41
|
+
<!-- Link any related issues, e.g., "Closes #123" -->
|
|
42
|
+
|
|
43
|
+
## Additional Context
|
|
44
|
+
|
|
45
|
+
<!-- Add any other context about the PR here -->
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
name: CD
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
publish:
|
|
10
|
+
name: Publish Release
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
|
|
13
|
+
steps:
|
|
14
|
+
- name: Checkout
|
|
15
|
+
uses: actions/checkout@v4
|
|
16
|
+
|
|
17
|
+
- name: Setup Node.js
|
|
18
|
+
uses: actions/setup-node@v4
|
|
19
|
+
with:
|
|
20
|
+
node-version: '20'
|
|
21
|
+
cache: 'npm'
|
|
22
|
+
|
|
23
|
+
- name: Install dependencies
|
|
24
|
+
run: npm ci
|
|
25
|
+
|
|
26
|
+
- name: Build
|
|
27
|
+
run: npm run build
|
|
28
|
+
|
|
29
|
+
- name: Publish to npm
|
|
30
|
+
run: npm publish
|
|
31
|
+
env:
|
|
32
|
+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
33
|
+
|
|
34
|
+
- name: Publish to Docker Hub
|
|
35
|
+
uses: docker/build-push-action@v5
|
|
36
|
+
with:
|
|
37
|
+
context: .
|
|
38
|
+
file: docker/Dockerfile
|
|
39
|
+
push: true
|
|
40
|
+
tags: |
|
|
41
|
+
opensidian:${{ github.event.release.tag_name }}
|
|
42
|
+
opensidian:latest
|
|
43
|
+
env:
|
|
44
|
+
DOCKER_BUILDKIT: 1
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main, develop]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main, develop]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test:
|
|
11
|
+
name: Test
|
|
12
|
+
runs-on: ${{ matrix.os }}
|
|
13
|
+
strategy:
|
|
14
|
+
matrix:
|
|
15
|
+
os: [ubuntu-latest, windows-latest, macos-latest]
|
|
16
|
+
node: ['20', '22']
|
|
17
|
+
|
|
18
|
+
steps:
|
|
19
|
+
- name: Checkout
|
|
20
|
+
uses: actions/checkout@v4
|
|
21
|
+
|
|
22
|
+
- name: Setup Node.js ${{ matrix.node }}
|
|
23
|
+
uses: actions/setup-node@v4
|
|
24
|
+
with:
|
|
25
|
+
node-version: ${{ matrix.node }}
|
|
26
|
+
cache: 'npm'
|
|
27
|
+
|
|
28
|
+
- name: Install dependencies
|
|
29
|
+
run: npm ci
|
|
30
|
+
|
|
31
|
+
- name: Run lint
|
|
32
|
+
run: npm run lint
|
|
33
|
+
|
|
34
|
+
- name: Run typecheck
|
|
35
|
+
run: npm run typecheck
|
|
36
|
+
|
|
37
|
+
- name: Run tests with coverage
|
|
38
|
+
run: npm run test:coverage
|
|
39
|
+
|
|
40
|
+
- name: Upload coverage to Codecov
|
|
41
|
+
uses: codecov/codecov-action@v4
|
|
42
|
+
if: matrix.os == 'ubuntu-latest' && matrix.node == '20'
|
|
43
|
+
with:
|
|
44
|
+
token: ${{ secrets.CCODECOV_TOKEN }}
|
|
45
|
+
|
|
46
|
+
build:
|
|
47
|
+
name: Build
|
|
48
|
+
runs-on: ubuntu-latest
|
|
49
|
+
needs: test
|
|
50
|
+
|
|
51
|
+
steps:
|
|
52
|
+
- name: Checkout
|
|
53
|
+
uses: actions/checkout@v4
|
|
54
|
+
|
|
55
|
+
- name: Setup Node.js
|
|
56
|
+
uses: actions/setup-node@v4
|
|
57
|
+
with:
|
|
58
|
+
node-version: '20'
|
|
59
|
+
cache: 'npm'
|
|
60
|
+
|
|
61
|
+
- name: Install dependencies
|
|
62
|
+
run: npm ci
|
|
63
|
+
|
|
64
|
+
- name: Build
|
|
65
|
+
run: npm run build
|
|
66
|
+
|
|
67
|
+
- name: Upload build artifacts
|
|
68
|
+
uses: actions/upload-artifact@v4
|
|
69
|
+
with:
|
|
70
|
+
name: dist
|
|
71
|
+
path: dist/
|
|
72
|
+
|
|
73
|
+
build-docker:
|
|
74
|
+
name: Build Docker
|
|
75
|
+
runs-on: ubuntu-latest
|
|
76
|
+
needs: build
|
|
77
|
+
|
|
78
|
+
steps:
|
|
79
|
+
- name: Checkout
|
|
80
|
+
uses: actions/checkout@v4
|
|
81
|
+
|
|
82
|
+
- name: Set up Docker Buildx
|
|
83
|
+
uses: docker/setup-buildx-action@v3
|
|
84
|
+
|
|
85
|
+
- name: Login to Docker Hub
|
|
86
|
+
uses: docker/login-action@v3
|
|
87
|
+
with:
|
|
88
|
+
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
89
|
+
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
90
|
+
|
|
91
|
+
- name: Build and push
|
|
92
|
+
uses: docker/build-push-action@v5
|
|
93
|
+
with:
|
|
94
|
+
context: .
|
|
95
|
+
file: docker/Dockerfile
|
|
96
|
+
push: ${{ github.event_name != 'pull_request' }}
|
|
97
|
+
tags: |
|
|
98
|
+
opensidian:latest
|
|
99
|
+
opensidian:${{ github.sha }}
|
|
100
|
+
cache-from: type=gha
|
|
101
|
+
cache-to: type=gha,mode=max
|
|
102
|
+
|
|
103
|
+
release:
|
|
104
|
+
name: Release
|
|
105
|
+
runs-on: ubuntu-latest
|
|
106
|
+
needs: build-docker
|
|
107
|
+
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
|
108
|
+
|
|
109
|
+
steps:
|
|
110
|
+
- name: Checkout
|
|
111
|
+
uses: actions/checkout@v4
|
|
112
|
+
|
|
113
|
+
- name: Setup Node.js
|
|
114
|
+
uses: actions/setup-node@v4
|
|
115
|
+
with:
|
|
116
|
+
node-version: '20'
|
|
117
|
+
cache: 'npm'
|
|
118
|
+
|
|
119
|
+
- name: Install dependencies
|
|
120
|
+
run: npm ci
|
|
121
|
+
|
|
122
|
+
- name: Create Release
|
|
123
|
+
uses: softprops/action-gh-release@v2
|
|
124
|
+
with:
|
|
125
|
+
files: dist/*
|
|
126
|
+
generate_release_notes: true
|
|
127
|
+
env:
|
|
128
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
name: QA Review
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
types: [opened, synchronize, reopened]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
code-review:
|
|
9
|
+
name: Code Quality Review
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
|
|
12
|
+
steps:
|
|
13
|
+
- name: Checkout
|
|
14
|
+
uses: actions/checkout@v4
|
|
15
|
+
|
|
16
|
+
- name: Setup Node.js
|
|
17
|
+
uses: actions/setup-node@v4
|
|
18
|
+
with:
|
|
19
|
+
node-version: '20'
|
|
20
|
+
cache: 'npm'
|
|
21
|
+
|
|
22
|
+
- name: Install dependencies
|
|
23
|
+
run: npm ci
|
|
24
|
+
|
|
25
|
+
- name: Run analysis
|
|
26
|
+
run: |
|
|
27
|
+
npm run lint
|
|
28
|
+
npm run typecheck
|
|
29
|
+
npm run test
|
|
30
|
+
|
|
31
|
+
- name: Check file size
|
|
32
|
+
run: |
|
|
33
|
+
npm run build
|
|
34
|
+
du -sh dist/
|
|
35
|
+
|
|
36
|
+
- name: Comment PR
|
|
37
|
+
uses: actions/github-script@v7
|
|
38
|
+
with:
|
|
39
|
+
script: |
|
|
40
|
+
github.rest.issues.createComment({
|
|
41
|
+
issue_number: context.issue.number,
|
|
42
|
+
owner: context.repo.owner,
|
|
43
|
+
repo: context.repo.repo,
|
|
44
|
+
body: '## QA Report\n\nBuild and tests completed successfully.'
|
|
45
|
+
})
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# OpenSidian
|
|
2
|
+
|
|
3
|
+
## What This Is
|
|
4
|
+
|
|
5
|
+
OpenSidian é um sistema de gerenciamento de conhecimento open-source inspirado no Obsidian. Ele permite criar, organizar e interconectar notas em Markdown com indexação de grafo de conhecimento, sincronização em tempo real e suporte a plugins. O projeto já possui código funcional (servidor MCP, API REST, WebSocket sync, plugin host) e está rodando em produção local.
|
|
6
|
+
|
|
7
|
+
## Core Value
|
|
8
|
+
|
|
9
|
+
Usuários podem escrever notas em Markdown, conectá-las com links `[[wikilink]]`, visualizar o grafo de conhecimento e sincronizar em tempo real — tudo open-source e auto-hospedável.
|
|
10
|
+
|
|
11
|
+
## Requirements
|
|
12
|
+
|
|
13
|
+
### Validated
|
|
14
|
+
|
|
15
|
+
- ✓ **Vault Manager**: criar, abrir e gerenciar vaults de notas — `src/core/vault.ts`
|
|
16
|
+
- ✓ **Markdown Parser**: parsing de Markdown com frontmatter, links e headings — `src/core/markdown.ts`
|
|
17
|
+
- ✓ **Graph Engine**: indexação de grafo de conhecimento com vizinhança e backlinks — `src/core/graph.ts`
|
|
18
|
+
- ✓ **Sync Service**: sincronização em tempo real via WebSocket — `src/core/sync.ts`
|
|
19
|
+
- ✓ **Plugin Host**: sistema de plugins com comandos e hooks — `src/plugins/host.ts`
|
|
20
|
+
- ✓ **MCP Server**: servidor Model Context Protocol com tools para vault/notas/grafo — `src/mcp/server.ts`
|
|
21
|
+
- ✓ **REST API**: endpoints para vaults, notas e grafo — `src/api/routes.ts`
|
|
22
|
+
- ✓ **CI/CD**: GitHub Actions para testes, build e release multiplataforma — `.github/workflows/`
|
|
23
|
+
- ✓ **Docker**: containerização multi-stage com docker-compose — `docker/`
|
|
24
|
+
- ✓ **Testes**: 67 testes passando com cobertura >80% — `tests/`
|
|
25
|
+
- ✓ **Licença MIT**: `LICENSE`
|
|
26
|
+
|
|
27
|
+
### Active
|
|
28
|
+
|
|
29
|
+
- [ ] **Interface Web**: UI para visualizar e editar notas, grafo e configurações
|
|
30
|
+
- [ ] **Autenticação**: login com email/senha e sessão persistente
|
|
31
|
+
- [ ] **Busca Full-Text**: busca avançada com indexação de conteúdo
|
|
32
|
+
- [ ] **Temas Customizáveis**: suporte a temas com CSS variables
|
|
33
|
+
- [ ] **Plugin Registry**: marketplace ou repositório de plugins
|
|
34
|
+
- [ ] **Backup Automático**: snapshots e restore de vaults
|
|
35
|
+
- [ ] **API de Plugins documentada**: SDK público para desenvolvedores
|
|
36
|
+
- [ ] **Modo Offline**: suporte a PWA/Electron para uso sem internet
|
|
37
|
+
- [ ] **Colaboração**: edição simultânea com CRDT/OT
|
|
38
|
+
|
|
39
|
+
### Out of Scope
|
|
40
|
+
|
|
41
|
+
- Aplicativo mobile nativo — foco em web + PWA por enquanto
|
|
42
|
+
- Suporte a formatos não-Markdown (PDF, DOCX) — conversão via plugins
|
|
43
|
+
- Armazenamento cloud proprietário — cada um escolhe onde hospedar
|
|
44
|
+
|
|
45
|
+
## Context
|
|
46
|
+
|
|
47
|
+
Projeto iniciado do zero como clone open-source do Obsidian. Todo o backend core está funcional. O próximo passo é construir a interface web e melhorar a experiência do usuário.
|
|
48
|
+
|
|
49
|
+
Stack atual: TypeScript, Node.js, Express, WebSocket, MCP SDK, Vitest, Docker.
|
|
50
|
+
|
|
51
|
+
Repositório: [thiagovasconcelosti/opensidian](https://github.com/thiagovasconcelosti/opensidian)
|
|
52
|
+
|
|
53
|
+
## Constraints
|
|
54
|
+
|
|
55
|
+
- **Node.js**: runtime obrigatório (>=20), sem Python/Go no backend
|
|
56
|
+
- **Compatibilidade**: must support Windows, macOS e Linux
|
|
57
|
+
- **Formato**: notas em `.md` padrão, sem lock-in
|
|
58
|
+
|
|
59
|
+
## Key Decisions
|
|
60
|
+
|
|
61
|
+
| Decision | Rationale | Outcome |
|
|
62
|
+
|----------|-----------|---------|
|
|
63
|
+
| TypeScript + Node.js | Ecossistema maduro, tipagem segura, mesma linguagem front/back | ✓ Good |
|
|
64
|
+
| MCP SDK oficial | Integração nativa com LLMs sem reinventar protocolo | ✓ Good |
|
|
65
|
+
| Markdown puro sem custom syntax | Máxima compatibilidade com outras ferramentas | ✓ Good |
|
|
66
|
+
| Vitest em vez de Jest | Mais rápido, nativo ESM, integração Vite | ✓ Good |
|
|
67
|
+
|
|
68
|
+
## Evolution
|
|
69
|
+
|
|
70
|
+
This document evolves at phase transitions and milestone boundaries.
|
|
71
|
+
|
|
72
|
+
**After each phase transition:**
|
|
73
|
+
1. Requirements invalidated? → Move to Out of Scope with reason
|
|
74
|
+
2. Requirements validated? → Move to Validated with phase reference
|
|
75
|
+
3. New requirements emerged? → Add to Active
|
|
76
|
+
4. Decisions to log? → Add to Key Decisions
|
|
77
|
+
5. "What This Is" still accurate? → Update if drifted
|
|
78
|
+
|
|
79
|
+
**After each milestone:**
|
|
80
|
+
1. Full review of all sections
|
|
81
|
+
2. Core Value check — still the right priority?
|
|
82
|
+
3. Audit Out of Scope — reasons still valid?
|
|
83
|
+
4. Update Context with current state
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
## Current Milestone: v2.0 Busca Full-Text
|
|
87
|
+
|
|
88
|
+
**Goal:** Implementar busca full-text com indexação, highlighting e filtros por tag/data.
|
|
89
|
+
|
|
90
|
+
**Target features:**
|
|
91
|
+
- Indexador full-text que analisa conteúdo de notas
|
|
92
|
+
- API de busca com query string, highlighting e filtros
|
|
93
|
+
- UI de busca integrada ao editor com resultados em tempo real
|
|
94
|
+
- Filtros por tag, data de modificação e tipo de link
|
|
95
|
+
|
|
96
|
+
*Last updated: 2026-05-06 after milestone v2.0 start*
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# Requirements: OpenSidian — Milestone v2.0
|
|
2
|
+
|
|
3
|
+
**Defined:** 2026-05-06
|
|
4
|
+
**Milestone:** v2.0 — Busca Full-Text
|
|
5
|
+
**Core Value:** Usuários podem escrever notas em Markdown, conectá-las com links, visualizar o grafo de conhecimento e sincronizar em tempo real — open-source e auto-hospedável.
|
|
6
|
+
|
|
7
|
+
## v2.0 Requirements
|
|
8
|
+
|
|
9
|
+
### Indexação Full-Text
|
|
10
|
+
|
|
11
|
+
- [ ] **SRCH-01**: Indexador processa conteúdo de todas as notas de um vault
|
|
12
|
+
- [ ] **SRCH-02**: Indexação é incremental (só reindexa notas modificadas)
|
|
13
|
+
- [ ] **SRCH-03**: Indexador extrai termos do body e do frontmatter
|
|
14
|
+
- [ ] **SRCH-04**: Indexador ignora stopwords e normaliza acentos
|
|
15
|
+
- [ ] **SRCH-05**: Índice persiste em disco entre reinicializações
|
|
16
|
+
|
|
17
|
+
### API de Busca
|
|
18
|
+
|
|
19
|
+
- [ ] **SRCH-06**: Endpoint GET `/api/notes/search?vault=&q=` retorna resultados
|
|
20
|
+
- [ ] **SRCH-07**: Resultados incluem trecho do conteúdo com highlighting
|
|
21
|
+
- [ ] **SRCH-08**: Filtro por tag (`tag:javascript`)
|
|
22
|
+
- [ ] **SRCH-09**: Filtro por data (`after:2026-01-01 before:2026-06-01`)
|
|
23
|
+
- [ ] **SRCH-10**: Filtro por tipo de link (`hasBacklinks:true`)
|
|
24
|
+
- [ ] **SRCH-11**: Ordenação por relevância (TF-IDF ou similar)
|
|
25
|
+
|
|
26
|
+
### Frontend de Busca
|
|
27
|
+
|
|
28
|
+
- [ ] **SRCH-12**: Input de busca na toolbar com resultados em dropdown
|
|
29
|
+
- [ ] **SRCH-13**: Resultados mostram título, trecho com highlight e metadata
|
|
30
|
+
- [ ] **SRCH-14**: Painel de busca avançada com filtros (tag, data, tipo)
|
|
31
|
+
- [ ] **SRCH-15**: Navegação para nota ao clicar no resultado
|
|
32
|
+
|
|
33
|
+
### MCP Search Tool
|
|
34
|
+
|
|
35
|
+
- [ ] **SRCH-16**: Tool MCP `note_search` retorna resultados com highlighting
|
|
36
|
+
- [ ] **SRCH-17**: Tool MCP aceita filtros (tag, data) como parâmetros opcionais
|
|
37
|
+
|
|
38
|
+
## Future Requirements
|
|
39
|
+
|
|
40
|
+
- **SRCH-18**: Busca fuzzy (tolerância a erros de digitação)
|
|
41
|
+
- **SRCH-19**: Sugestões de busca enquanto digita (autocomplete)
|
|
42
|
+
- **SRCH-20**: Busca em anexos (PDF, DOCX) via plugin
|
|
43
|
+
|
|
44
|
+
## Out of Scope
|
|
45
|
+
|
|
46
|
+
| Feature | Reason |
|
|
47
|
+
|---------|--------|
|
|
48
|
+
| Busca em múltiplos idiomas | Stopwords só em português/inglês por enquanto |
|
|
49
|
+
| Busca por similaridade semântica (embedding) | Exige modelo ML, custo alto |
|
|
50
|
+
|
|
51
|
+
## Traceability
|
|
52
|
+
|
|
53
|
+
| Requirement | Phase | Status |
|
|
54
|
+
|-------------|-------|--------|
|
|
55
|
+
| SRCH-01 a SRCH-05 | Phase 8 (Indexador) | Pending |
|
|
56
|
+
| SRCH-06 a SRCH-11 | Phase 9 (API) | Pending |
|
|
57
|
+
| SRCH-12 a SRCH-15 | Phase 10 (Frontend) | Pending |
|
|
58
|
+
| SRCH-16 a SRCH-17 | Phase 9 (API) | Pending |
|
|
59
|
+
|
|
60
|
+
**Coverage:**
|
|
61
|
+
- v2.0 requirements: 17 total
|
|
62
|
+
- Mapped to phases: 17
|
|
63
|
+
- Unmapped: 0 ✓
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
*Requirements defined: 2026-05-06 for milestone v2.0*
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
# Roadmap: OpenSidian
|
|
2
|
+
|
|
3
|
+
**Version:** 2.0.0
|
|
4
|
+
**Milestone:** v2.0 ✅ Complete
|
|
5
|
+
|
|
6
|
+
## v1.0 Phases (Complete)
|
|
7
|
+
|
|
8
|
+
### Phase 1: Backend Core
|
|
9
|
+
**Goal:** Base do sistema funcional (vault, markdown, graph)
|
|
10
|
+
**Requirements:** VAULT-01 a VAULT-03, MD-01 a MD-03, GRAPH-01 a GRAPH-05, CI-01 a CI-03, DOCKER-01 a DOCKER-02
|
|
11
|
+
**Status:** Complete
|
|
12
|
+
**Success criteria:**
|
|
13
|
+
1. Usuário pode criar, abrir e listar vaults
|
|
14
|
+
2. Sistema faz parsing de Markdown com frontmatter e links
|
|
15
|
+
3. Grafo de conhecimento é indexado automaticamente
|
|
16
|
+
4. Testes e CI estão funcionando
|
|
17
|
+
|
|
18
|
+
### Phase 2: Sync & API
|
|
19
|
+
**Goal:** APIs REST, WebSocket sync e servidor MCP
|
|
20
|
+
**Requirements:** SYNC-01 a SYNC-02, MCP-01 a MCP-06, API-01 a API-05
|
|
21
|
+
**Status:** Complete
|
|
22
|
+
**Success criteria:**
|
|
23
|
+
1. Alterações em notas são sincronizadas via WebSocket
|
|
24
|
+
2. Servidor MCP expõe tools para vault, notas e grafo
|
|
25
|
+
3. REST API responde corretamente para todos os endpoints
|
|
26
|
+
4. Sistema lida com erros de forma tipada
|
|
27
|
+
|
|
28
|
+
### Phase 3: Plugin System
|
|
29
|
+
**Goal:** Arquitetura extensível com plugins
|
|
30
|
+
**Requirements:** PLUGIN-01 a PLUGIN-05
|
|
31
|
+
**Status:** Complete
|
|
32
|
+
**Success criteria:**
|
|
33
|
+
1. Plugin pode ser carregado e descarregado em runtime
|
|
34
|
+
2. Plugin pode registrar comandos e hooks
|
|
35
|
+
3. Hooks executam em sequência sem quebrar com erros
|
|
36
|
+
4. Plugin de exemplo funcional incluso
|
|
37
|
+
|
|
38
|
+
### Phase 4: Web UI
|
|
39
|
+
**Goal:** Interface web para uso diário
|
|
40
|
+
**Requirements:** WEB-01 a WEB-07, SEARCH-01 a SEARCH-03
|
|
41
|
+
**Status:** Complete
|
|
42
|
+
**Success criteria:**
|
|
43
|
+
1. ✅ Usuário vê lista de notas e pode criar novas
|
|
44
|
+
2. ✅ Editor Markdown com preview ao vivo
|
|
45
|
+
3. ✅ Grafo de conhecimento interativo (D3.js)
|
|
46
|
+
4. ✅ Navegação entre notas por clique em links
|
|
47
|
+
5. ✅ Busca funcional com resultados em tempo real
|
|
48
|
+
6. ✅ Interface responsiva (desktop e mobile)
|
|
49
|
+
7. ✅ Servidor Express serve frontend buildado em produção
|
|
50
|
+
**UI hint**: yes
|
|
51
|
+
|
|
52
|
+
### Phase 5: Authentication
|
|
53
|
+
**Goal:** Segurança com login e sessão
|
|
54
|
+
**Requirements:** AUTH-01 a AUTH-04
|
|
55
|
+
**Status:** Complete
|
|
56
|
+
**Success criteria:**
|
|
57
|
+
1. ✅ Usuário cria conta com email/senha
|
|
58
|
+
2. ✅ Login persiste após refresh (JWT + localStorage)
|
|
59
|
+
3. ✅ Logout invalida sessão
|
|
60
|
+
4. ✅ Rotas protegidas redirecionam para login
|
|
61
|
+
5. ✅ Nome e email do usuário visíveis na sidebar
|
|
62
|
+
**Dependencies:** Phase 4
|
|
63
|
+
|
|
64
|
+
### Phase 6: Themes
|
|
65
|
+
**Goal:** Suporte a temas customizáveis
|
|
66
|
+
**Requirements:** THEME-01 a THEME-03
|
|
67
|
+
**Status:** Complete
|
|
68
|
+
**Success criteria:**
|
|
69
|
+
1. ✅ Temas claro e escuro inclusos
|
|
70
|
+
2. ✅ Usuário pode criar temas com CSS variables (editor visual)
|
|
71
|
+
3. ✅ Troca de tema sem refresh
|
|
72
|
+
4. ✅ Temas persistem no localStorage
|
|
73
|
+
5. ✅ Temas salvos no servidor e listados na sidebar
|
|
74
|
+
**Dependencies:** Phase 4
|
|
75
|
+
|
|
76
|
+
### Phase 7: Polish & Release
|
|
77
|
+
**Goal:** Documentação, SDK de plugins e release 1.0
|
|
78
|
+
**Requirements:** REG-01 a REG-03
|
|
79
|
+
**Status:** Complete
|
|
80
|
+
**Success criteria:**
|
|
81
|
+
1. ✅ Documentação completa no README (API, plugins, MCP, Docker)
|
|
82
|
+
2. ✅ Guia de contribuição atualizado no CONTRIBUTING.md
|
|
83
|
+
3. ✅ Documentação da API de plugins publicada
|
|
84
|
+
4. ✅ Badge CI e license no README
|
|
85
|
+
5. ✅ Release 1.0 via GitHub Actions configurado
|
|
86
|
+
**Dependencies:** Phase 5, Phase 6
|
|
87
|
+
|
|
88
|
+
## v2.0 Phases
|
|
89
|
+
|
|
90
|
+
### Phase 8: Indexador Full-Text
|
|
91
|
+
**Goal:** Indexador que processa conteúdo das notas e persiste em disco
|
|
92
|
+
**Requirements:** SRCH-01 a SRCH-05
|
|
93
|
+
**Status:** Complete
|
|
94
|
+
**Success criteria:**
|
|
95
|
+
1. ✅ Indexador processa vaults existentes e novas notas automaticamente
|
|
96
|
+
2. ✅ Indexação incremental via VaultManager (indexOnCreate/Update/Delete)
|
|
97
|
+
3. ✅ Termos extraídos do body, frontmatter e tags
|
|
98
|
+
4. ✅ Stopwords removidas, acentos normalizados (NFD)
|
|
99
|
+
5. ✅ Índice salvo em disco (JSON) sobrevive a restart
|
|
100
|
+
6. ✅ Ranking TF-IDF implementado
|
|
101
|
+
7. ✅ 12 novos testes, total 79 testes passando
|
|
102
|
+
|
|
103
|
+
### Phase 9: API de Busca
|
|
104
|
+
**Goal:** Endpoint REST e MCP tool com highlighting e filtros
|
|
105
|
+
**Requirements:** SRCH-06 a SRCH-11, SRCH-16 a SRCH-17
|
|
106
|
+
**Status:** Complete
|
|
107
|
+
**Success criteria:**
|
|
108
|
+
1. ✅ GET `/api/notes/search?q=` retorna resultados ordenados por relevância
|
|
109
|
+
2. ✅ Resultados incluem snippet com highlighting
|
|
110
|
+
3. ✅ Filtro `tag:` funcional
|
|
111
|
+
4. ✅ Filtro `after:`/`before:` funcional
|
|
112
|
+
5. ✅ Filtro `hasBacklinks:` funcional
|
|
113
|
+
6. ✅ Tool MCP `note_search` aceita filtros opcionais
|
|
114
|
+
7. ✅ Frontend SearchBar usa full-text search com highlighting
|
|
115
|
+
|
|
116
|
+
### Phase 10: Frontend de Busca
|
|
117
|
+
**Goal:** UI de busca com dropdown e painel avançado de filtros
|
|
118
|
+
**Requirements:** SRCH-12 a SRCH-15
|
|
119
|
+
**Status:** Complete
|
|
120
|
+
**Success criteria:**
|
|
121
|
+
1. ✅ Input de busca na toolbar com dropdown de resultados com highlight
|
|
122
|
+
2. ✅ Resultado mostra título, trecho com highlight e metadata
|
|
123
|
+
3. ✅ Painel de busca avançada com filtros visuais (tag, data, backlinks)
|
|
124
|
+
4. ✅ Clique no resultado navega para a nota
|
|
125
|
+
5. ✅ Rota /search com busca full-text e filtros
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
*Roadmap created: 2026-05-06*
|
|
129
|
+
*Updated: 2026-05-06 — v2.0 phases added*
|