mindyard 0.1.0__tar.gz
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.
- mindyard-0.1.0/.dockerignore +8 -0
- mindyard-0.1.0/.github/workflows/ci.yml +23 -0
- mindyard-0.1.0/.github/workflows/release.yml +50 -0
- mindyard-0.1.0/.gitignore +11 -0
- mindyard-0.1.0/CLA.md +117 -0
- mindyard-0.1.0/CONTRIBUTING.md +36 -0
- mindyard-0.1.0/Dockerfile +28 -0
- mindyard-0.1.0/LICENSE +661 -0
- mindyard-0.1.0/PKG-INFO +124 -0
- mindyard-0.1.0/README.md +110 -0
- mindyard-0.1.0/SECURITY.md +23 -0
- mindyard-0.1.0/compose.example.yaml +18 -0
- mindyard-0.1.0/pyproject.toml +61 -0
- mindyard-0.1.0/scripts/check-provenance.sh +21 -0
- mindyard-0.1.0/skills/mindyard/SKILL.md +59 -0
- mindyard-0.1.0/src/mindyard/__init__.py +4 -0
- mindyard-0.1.0/src/mindyard/auth/__init__.py +21 -0
- mindyard-0.1.0/src/mindyard/auth/backends.py +169 -0
- mindyard-0.1.0/src/mindyard/auth/consent.py +76 -0
- mindyard-0.1.0/src/mindyard/auth/gate.py +78 -0
- mindyard-0.1.0/src/mindyard/auth/policy.py +46 -0
- mindyard-0.1.0/src/mindyard/auth/tokens.py +96 -0
- mindyard-0.1.0/src/mindyard/cli.py +132 -0
- mindyard-0.1.0/src/mindyard/core/config.py +66 -0
- mindyard-0.1.0/src/mindyard/core/errors.py +235 -0
- mindyard-0.1.0/src/mindyard/core/git.py +86 -0
- mindyard-0.1.0/src/mindyard/core/operations.py +525 -0
- mindyard-0.1.0/src/mindyard/core/paths.py +57 -0
- mindyard-0.1.0/src/mindyard/core/render.py +111 -0
- mindyard-0.1.0/src/mindyard/core/search.py +129 -0
- mindyard-0.1.0/src/mindyard/identity.py +52 -0
- mindyard-0.1.0/src/mindyard/init.py +46 -0
- mindyard-0.1.0/src/mindyard/lint/__init__.py +16 -0
- mindyard-0.1.0/src/mindyard/lint/checks.py +220 -0
- mindyard-0.1.0/src/mindyard/lint/markdown.py +104 -0
- mindyard-0.1.0/src/mindyard/lint/runner.py +97 -0
- mindyard-0.1.0/src/mindyard/mcp/__init__.py +7 -0
- mindyard-0.1.0/src/mindyard/mcp/accesslog.py +33 -0
- mindyard-0.1.0/src/mindyard/mcp/app.py +105 -0
- mindyard-0.1.0/src/mindyard/mcp/middleware.py +64 -0
- mindyard-0.1.0/src/mindyard/mcp/server.py +225 -0
- mindyard-0.1.0/src/mindyard/mcp/telemetry.py +145 -0
- mindyard-0.1.0/src/mindyard/schema/__init__.py +7 -0
- mindyard-0.1.0/src/mindyard/schema/discovery.py +52 -0
- mindyard-0.1.0/src/mindyard/schema/manifest.py +180 -0
- mindyard-0.1.0/src/mindyard/settings.py +135 -0
- mindyard-0.1.0/src/mindyard/static/icon-96.png +0 -0
- mindyard-0.1.0/src/mindyard/static/icon.svg +1 -0
- mindyard-0.1.0/src/mindyard/templates/blank/.gitignore +2 -0
- mindyard-0.1.0/src/mindyard/templates/blank/index.md +3 -0
- mindyard-0.1.0/src/mindyard/templates/blank/log.md +6 -0
- mindyard-0.1.0/src/mindyard/templates/blank/raw/.gitkeep +0 -0
- mindyard-0.1.0/src/mindyard/templates/blank/schema.md +37 -0
- mindyard-0.1.0/src/mindyard/templates/blank/wiki/.gitkeep +0 -0
- mindyard-0.1.0/src/mindyard/templates/blank/wiki.yaml +18 -0
- mindyard-0.1.0/src/mindyard/templates/demo/.gitignore +2 -0
- mindyard-0.1.0/src/mindyard/templates/demo/index.md +11 -0
- mindyard-0.1.0/src/mindyard/templates/demo/log.md +6 -0
- mindyard-0.1.0/src/mindyard/templates/demo/raw/2026-03-seed-swap-notes.md +5 -0
- mindyard-0.1.0/src/mindyard/templates/demo/schema.md +20 -0
- mindyard-0.1.0/src/mindyard/templates/demo/wiki/concepts/companion-planting.md +11 -0
- mindyard-0.1.0/src/mindyard/templates/demo/wiki/events/spring-seed-swap.md +13 -0
- mindyard-0.1.0/src/mindyard/templates/demo/wiki/plants/basil.md +13 -0
- mindyard-0.1.0/src/mindyard/templates/demo/wiki/plants/tomato.md +14 -0
- mindyard-0.1.0/src/mindyard/templates/demo/wiki.yaml +18 -0
- mindyard-0.1.0/src/mindyard/tenancy/__init__.py +26 -0
- mindyard-0.1.0/src/mindyard/tenancy/context.py +38 -0
- mindyard-0.1.0/src/mindyard/tenancy/resolver.py +121 -0
- mindyard-0.1.0/src/mindyard/tenancy/tenant.py +42 -0
- mindyard-0.1.0/tests/__init__.py +0 -0
- mindyard-0.1.0/tests/auth/__init__.py +0 -0
- mindyard-0.1.0/tests/auth/test_auth.py +144 -0
- mindyard-0.1.0/tests/auth/test_consent.py +118 -0
- mindyard-0.1.0/tests/auth/test_gate.py +174 -0
- mindyard-0.1.0/tests/conftest.py +72 -0
- mindyard-0.1.0/tests/core/__init__.py +0 -0
- mindyard-0.1.0/tests/core/test_git_ops.py +73 -0
- mindyard-0.1.0/tests/core/test_normalize.py +147 -0
- mindyard-0.1.0/tests/core/test_paths.py +91 -0
- mindyard-0.1.0/tests/core/test_read_tools.py +177 -0
- mindyard-0.1.0/tests/core/test_render.py +82 -0
- mindyard-0.1.0/tests/core/test_search.py +110 -0
- mindyard-0.1.0/tests/core/test_write_batch.py +855 -0
- mindyard-0.1.0/tests/lint/__init__.py +0 -0
- mindyard-0.1.0/tests/lint/test_lint.py +186 -0
- mindyard-0.1.0/tests/mcp/__init__.py +0 -0
- mindyard-0.1.0/tests/mcp/test_accesslog.py +33 -0
- mindyard-0.1.0/tests/mcp/test_app.py +68 -0
- mindyard-0.1.0/tests/mcp/test_http.py +85 -0
- mindyard-0.1.0/tests/mcp/test_server.py +225 -0
- mindyard-0.1.0/tests/schema/__init__.py +0 -0
- mindyard-0.1.0/tests/schema/test_manifest.py +132 -0
- mindyard-0.1.0/tests/tenancy/__init__.py +0 -0
- mindyard-0.1.0/tests/tenancy/test_tenancy.py +157 -0
- mindyard-0.1.0/tests/test_cli.py +49 -0
- mindyard-0.1.0/tests/test_identity.py +31 -0
- mindyard-0.1.0/tests/test_package.py +6 -0
- mindyard-0.1.0/tests/test_settings.py +69 -0
- mindyard-0.1.0/uv.lock +1914 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
checks:
|
|
13
|
+
runs-on: ubuntu-latest
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v4
|
|
16
|
+
- uses: astral-sh/setup-uv@v10.3.0
|
|
17
|
+
with:
|
|
18
|
+
python-version: "3.12"
|
|
19
|
+
- run: uv sync --frozen
|
|
20
|
+
- run: uv run ruff check
|
|
21
|
+
- run: uv run ruff format --check
|
|
22
|
+
- run: uv run mypy
|
|
23
|
+
- run: uv run pytest -q
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
tags: ["v*"]
|
|
6
|
+
|
|
7
|
+
permissions:
|
|
8
|
+
contents: read
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
build:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v4
|
|
15
|
+
- uses: astral-sh/setup-uv@v10.3.0
|
|
16
|
+
with:
|
|
17
|
+
python-version: "3.12"
|
|
18
|
+
- run: uv sync --frozen
|
|
19
|
+
- run: uv run ruff check
|
|
20
|
+
- run: uv run ruff format --check
|
|
21
|
+
- run: uv run mypy
|
|
22
|
+
- run: uv run pytest -q
|
|
23
|
+
- name: Tag matches the package version
|
|
24
|
+
run: |
|
|
25
|
+
version="$(uv run python -c 'import mindyard; print(mindyard.__version__)')"
|
|
26
|
+
test "v$version" = "$GITHUB_REF_NAME" || {
|
|
27
|
+
echo "tag $GITHUB_REF_NAME does not match version $version" >&2
|
|
28
|
+
exit 1
|
|
29
|
+
}
|
|
30
|
+
- run: uv build
|
|
31
|
+
- uses: actions/upload-artifact@v4
|
|
32
|
+
with:
|
|
33
|
+
name: dist
|
|
34
|
+
path: dist/
|
|
35
|
+
|
|
36
|
+
publish:
|
|
37
|
+
needs: build
|
|
38
|
+
runs-on: ubuntu-latest
|
|
39
|
+
# Trusted publishing: PyPI trusts this workflow and environment, no token is stored.
|
|
40
|
+
environment:
|
|
41
|
+
name: pypi
|
|
42
|
+
url: https://pypi.org/project/mindyard/
|
|
43
|
+
permissions:
|
|
44
|
+
id-token: write
|
|
45
|
+
steps:
|
|
46
|
+
- uses: actions/download-artifact@v4
|
|
47
|
+
with:
|
|
48
|
+
name: dist
|
|
49
|
+
path: dist/
|
|
50
|
+
- uses: pypa/gh-action-pypi-publish@release/v1
|
mindyard-0.1.0/CLA.md
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# mindyard Individual Contributor License Agreement
|
|
2
|
+
|
|
3
|
+
Version 1.0. Adapted from the Apache Software Foundation Individual Contributor
|
|
4
|
+
License Agreement v2.2.
|
|
5
|
+
|
|
6
|
+
Thank you for your interest in contributing to mindyard. To clarify the
|
|
7
|
+
intellectual property license granted with Contributions, the Maintainer asks
|
|
8
|
+
each Contributor to accept this Agreement before a Contribution is merged. It
|
|
9
|
+
does not change your rights to use your own Contributions for any other purpose.
|
|
10
|
+
|
|
11
|
+
You accept and agree to the following terms and conditions for Your
|
|
12
|
+
Contributions (present and future) that you submit to the Maintainer. Except
|
|
13
|
+
for the license granted herein to the Maintainer and recipients of software
|
|
14
|
+
distributed by the Maintainer, You reserve all right, title, and interest in
|
|
15
|
+
and to Your Contributions.
|
|
16
|
+
|
|
17
|
+
## 1. Definitions
|
|
18
|
+
|
|
19
|
+
"Maintainer" shall mean Florian Triclin, and his successors and assigns,
|
|
20
|
+
including any legal entity to which he transfers the mindyard project.
|
|
21
|
+
|
|
22
|
+
"You" (or "Your") shall mean the copyright owner or legal entity authorized by
|
|
23
|
+
the copyright owner that is making this Agreement with the Maintainer. For
|
|
24
|
+
legal entities, the entity making a Contribution and all other entities that
|
|
25
|
+
control, are controlled by, or are under common control with that entity are
|
|
26
|
+
considered to be a single Contributor. For the purposes of this definition,
|
|
27
|
+
"control" means (i) the power, direct or indirect, to cause the direction or
|
|
28
|
+
management of such entity, whether by contract or otherwise, or (ii) ownership
|
|
29
|
+
of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial
|
|
30
|
+
ownership of such entity.
|
|
31
|
+
|
|
32
|
+
"Contribution" shall mean any original work of authorship, including any
|
|
33
|
+
modifications or additions to an existing work, that is intentionally submitted
|
|
34
|
+
by You to the Maintainer for inclusion in, or documentation of, mindyard (the
|
|
35
|
+
"Work"). For the purposes of this definition, "submitted" means any form of
|
|
36
|
+
electronic, verbal, or written communication sent to the Maintainer or its
|
|
37
|
+
representatives, including but not limited to communication on source code
|
|
38
|
+
control systems and issue tracking systems that are managed by, or on behalf
|
|
39
|
+
of, the Maintainer for the purpose of discussing and improving the Work, but
|
|
40
|
+
excluding communication that is conspicuously marked or otherwise designated in
|
|
41
|
+
writing by You as "Not a Contribution."
|
|
42
|
+
|
|
43
|
+
## 2. Grant of Copyright License
|
|
44
|
+
|
|
45
|
+
Subject to the terms and conditions of this Agreement, You hereby grant to the
|
|
46
|
+
Maintainer and to recipients of software distributed by the Maintainer a
|
|
47
|
+
perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
48
|
+
copyright license to reproduce, prepare derivative works of, publicly display,
|
|
49
|
+
publicly perform, sublicense, and distribute Your Contributions and such
|
|
50
|
+
derivative works.
|
|
51
|
+
|
|
52
|
+
For the avoidance of doubt, this license allows the Maintainer to distribute
|
|
53
|
+
Your Contributions, and works that include them, under the terms of the GNU
|
|
54
|
+
Affero General Public License or under any other license terms, including
|
|
55
|
+
commercial ones.
|
|
56
|
+
|
|
57
|
+
## 3. Grant of Patent License
|
|
58
|
+
|
|
59
|
+
Subject to the terms and conditions of this Agreement, You hereby grant to the
|
|
60
|
+
Maintainer and to recipients of software distributed by the Maintainer a
|
|
61
|
+
perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
62
|
+
(except as stated in this section) patent license to make, have made, use,
|
|
63
|
+
offer to sell, sell, import, and otherwise transfer the Work, where such
|
|
64
|
+
license applies only to those patent claims licensable by You that are
|
|
65
|
+
necessarily infringed by Your Contribution(s) alone or by combination of Your
|
|
66
|
+
Contribution(s) with the Work to which such Contribution(s) was submitted. If
|
|
67
|
+
any entity institutes patent litigation against You or any other entity
|
|
68
|
+
(including a cross-claim or counterclaim in a lawsuit) alleging that Your
|
|
69
|
+
Contribution, or the Work to which You have contributed, constitutes direct or
|
|
70
|
+
contributory patent infringement, then any patent licenses granted to that
|
|
71
|
+
entity under this Agreement for that Contribution or Work shall terminate as of
|
|
72
|
+
the date such litigation is filed.
|
|
73
|
+
|
|
74
|
+
## 4. Your representations
|
|
75
|
+
|
|
76
|
+
You represent that You are legally entitled to grant the above license. If
|
|
77
|
+
Your employer(s) has rights to intellectual property that You create that
|
|
78
|
+
includes Your Contributions, You represent that You have received permission
|
|
79
|
+
to make Contributions on behalf of that employer, or that Your employer has
|
|
80
|
+
waived such rights for Your Contributions to the Maintainer.
|
|
81
|
+
|
|
82
|
+
You represent that each of Your Contributions is Your original creation (see
|
|
83
|
+
section 6 for submissions on behalf of others). You represent that Your
|
|
84
|
+
Contribution submissions include complete details of any third-party license
|
|
85
|
+
or other restriction (including, but not limited to, related patents and
|
|
86
|
+
trademarks) of which You are personally aware and which are associated with
|
|
87
|
+
any part of Your Contributions.
|
|
88
|
+
|
|
89
|
+
## 5. No support, no warranty
|
|
90
|
+
|
|
91
|
+
You are not expected to provide support for Your Contributions, except to the
|
|
92
|
+
extent You desire to provide support. You may provide support for free, for a
|
|
93
|
+
fee, or not at all. Unless required by applicable law or agreed to in writing,
|
|
94
|
+
You provide Your Contributions on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
95
|
+
CONDITIONS OF ANY KIND, either express or implied, including, without
|
|
96
|
+
limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT,
|
|
97
|
+
MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE.
|
|
98
|
+
|
|
99
|
+
## 6. Work that is not yours
|
|
100
|
+
|
|
101
|
+
Should You wish to submit work that is not Your original creation, You may
|
|
102
|
+
submit it to the Maintainer separately from any Contribution, identifying the
|
|
103
|
+
complete details of its source and of any license or other restriction
|
|
104
|
+
(including, but not limited to, related patents, trademarks, and license
|
|
105
|
+
agreements) of which You are personally aware, and conspicuously marking the
|
|
106
|
+
work as "Submitted on behalf of a third-party: [named here]".
|
|
107
|
+
|
|
108
|
+
## 7. Changes in circumstances
|
|
109
|
+
|
|
110
|
+
You agree to notify the Maintainer of any facts or circumstances of which You
|
|
111
|
+
become aware that would make these representations inaccurate in any respect.
|
|
112
|
+
|
|
113
|
+
## How to accept
|
|
114
|
+
|
|
115
|
+
Open a pull request: the CLA assistant bot comments on it with a link. Signing
|
|
116
|
+
there, with your GitHub account, records your acceptance of this Agreement for
|
|
117
|
+
all your Contributions.
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Contributing to mindyard
|
|
2
|
+
|
|
3
|
+
Thanks for considering a contribution. Bug reports, documentation fixes and
|
|
4
|
+
code are all welcome.
|
|
5
|
+
|
|
6
|
+
## Before your first pull request
|
|
7
|
+
|
|
8
|
+
mindyard asks every contributor to accept a Contributor License Agreement
|
|
9
|
+
([CLA.md](CLA.md)). You keep the copyright on your work; you grant the
|
|
10
|
+
maintainer a license that includes the right to sublicense, which keeps a
|
|
11
|
+
commercial license possible alongside the AGPL. A bot asks you to sign when you
|
|
12
|
+
open your first pull request; it takes one click.
|
|
13
|
+
|
|
14
|
+
## Development
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
uv sync
|
|
18
|
+
uv run ruff check && uv run ruff format --check && uv run mypy && uv run pytest
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
All four must pass; CI runs them on every pull request.
|
|
22
|
+
|
|
23
|
+
Ground rules:
|
|
24
|
+
|
|
25
|
+
- **No model calls on the server.** mindyard executes and records; it does not reason.
|
|
26
|
+
- **The invariants are tested, keep them tested**: path confinement, optimistic
|
|
27
|
+
concurrency (a stale-version error never quotes the current version), atomic
|
|
28
|
+
and per-wiki serialised `write_batch`, create-only `raw/`, `wiki.yaml` outside
|
|
29
|
+
the write zones, tenant derived from identity and never from an argument.
|
|
30
|
+
- **No real personal data**, in fixtures, examples or docs. Use invented names.
|
|
31
|
+
- Code, docstrings and docs in English; every Python file carries the
|
|
32
|
+
`SPDX-License-Identifier: AGPL-3.0-or-later` header.
|
|
33
|
+
|
|
34
|
+
## Reporting a vulnerability
|
|
35
|
+
|
|
36
|
+
Do not open a public issue: see [SECURITY.md](SECURITY.md).
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# mindyard: one container serving the vaults under /data over MCP (HTTP).
|
|
2
|
+
FROM python:3.12-slim
|
|
3
|
+
|
|
4
|
+
# git: every write_batch is a commit. ripgrep: fast search (a Python scan otherwise).
|
|
5
|
+
RUN apt-get update \
|
|
6
|
+
&& apt-get install -y --no-install-recommends git ripgrep \
|
|
7
|
+
&& rm -rf /var/lib/apt/lists/* \
|
|
8
|
+
&& git config --system --add safe.directory '*'
|
|
9
|
+
|
|
10
|
+
COPY --from=ghcr.io/astral-sh/uv:0.11.26 /uv /usr/local/bin/uv
|
|
11
|
+
WORKDIR /app
|
|
12
|
+
|
|
13
|
+
# Dependencies in their own layer, replayed from the lockfile without resolving.
|
|
14
|
+
COPY pyproject.toml uv.lock README.md LICENSE ./
|
|
15
|
+
RUN uv sync --frozen --no-dev --no-install-project
|
|
16
|
+
COPY src/ ./src/
|
|
17
|
+
RUN uv sync --frozen --no-dev --no-editable
|
|
18
|
+
|
|
19
|
+
ENV PATH="/app/.venv/bin:$PATH" \
|
|
20
|
+
MINDYARD_DATA_ROOT=/data \
|
|
21
|
+
MINDYARD_HOST=0.0.0.0 \
|
|
22
|
+
MINDYARD_PORT=8787
|
|
23
|
+
|
|
24
|
+
# No default auth: with MINDYARD_AUTH unset (none), the server refuses to bind
|
|
25
|
+
# 0.0.0.0 and exits. Pick bearer or google in the environment.
|
|
26
|
+
EXPOSE 8787
|
|
27
|
+
VOLUME ["/data"]
|
|
28
|
+
CMD ["mindyard", "serve"]
|