draftwatch 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.
- draftwatch-0.1.0/LICENSE +21 -0
- draftwatch-0.1.0/PKG-INFO +112 -0
- draftwatch-0.1.0/README.md +90 -0
- draftwatch-0.1.0/draftwatch/__init__.py +9 -0
- draftwatch-0.1.0/draftwatch/__main__.py +6 -0
- draftwatch-0.1.0/draftwatch/app.py +3208 -0
- draftwatch-0.1.0/draftwatch/assets/codemirror.js +28 -0
- draftwatch-0.1.0/draftwatch/assets/marked.js +6 -0
- draftwatch-0.1.0/draftwatch/assets/purify.js +3 -0
- draftwatch-0.1.0/draftwatch/assets/turndown.js +800 -0
- draftwatch-0.1.0/draftwatch.egg-info/PKG-INFO +112 -0
- draftwatch-0.1.0/draftwatch.egg-info/SOURCES.txt +16 -0
- draftwatch-0.1.0/draftwatch.egg-info/dependency_links.txt +1 -0
- draftwatch-0.1.0/draftwatch.egg-info/entry_points.txt +2 -0
- draftwatch-0.1.0/draftwatch.egg-info/requires.txt +3 -0
- draftwatch-0.1.0/draftwatch.egg-info/top_level.txt +1 -0
- draftwatch-0.1.0/pyproject.toml +37 -0
- draftwatch-0.1.0/setup.cfg +4 -0
draftwatch-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Mike Konczal
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: draftwatch
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Review an AI agent's edits to your writing files as a real git word-diff — keep or revert changes hunk by hunk, then commit.
|
|
5
|
+
Author: Mike Konczal
|
|
6
|
+
License: MIT
|
|
7
|
+
Keywords: git,diff,writing,review,ai,agent,markdown
|
|
8
|
+
Classifier: Development Status :: 4 - Beta
|
|
9
|
+
Classifier: Environment :: Web Environment
|
|
10
|
+
Classifier: Intended Audience :: End Users/Desktop
|
|
11
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
12
|
+
Classifier: Operating System :: OS Independent
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Topic :: Text Editors
|
|
15
|
+
Classifier: Topic :: Software Development :: Version Control :: Git
|
|
16
|
+
Requires-Python: >=3.9
|
|
17
|
+
Description-Content-Type: text/markdown
|
|
18
|
+
License-File: LICENSE
|
|
19
|
+
Provides-Extra: app
|
|
20
|
+
Requires-Dist: pywebview>=4.0; extra == "app"
|
|
21
|
+
Dynamic: license-file
|
|
22
|
+
|
|
23
|
+
# Draftwatch
|
|
24
|
+
|
|
25
|
+
Draftwatch is a lightweight IDE for writers that all them to review an AI agent's edits to their writing the way you'd review a pull request. Draftwatch shows the exact, git-backed word-diff of what changed in a file, lets you keep or revert each change, and commits when you're done.
|
|
26
|
+
|
|
27
|
+
The diff comes from git on your machine, not from the AI vendor and not from a JavaScript approximation. You get independent verification of what the agent actually did.
|
|
28
|
+
|
|
29
|
+
Python 3.9+ and git are the only requirements. The front-end libraries (CodeMirror 6, marked, DOMPurify, Turndown) are vendored and served locally, so it works offline and binds to localhost only.
|
|
30
|
+
|
|
31
|
+
## Install
|
|
32
|
+
|
|
33
|
+
Install straight from GitHub, no clone needed:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
# uv (recommended): run without installing
|
|
37
|
+
uvx --from git+https://github.com/mtkonczal/Draftwatch.git draftwatch draft.md
|
|
38
|
+
|
|
39
|
+
# pipx: install the `draftwatch` command onto your PATH
|
|
40
|
+
pipx install git+https://github.com/mtkonczal/Draftwatch.git
|
|
41
|
+
|
|
42
|
+
# pip
|
|
43
|
+
pip install git+https://github.com/mtkonczal/Draftwatch.git
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
For the native app window, add the `app` extra:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
pipx install "draftwatch[app] @ git+https://github.com/mtkonczal/Draftwatch.git"
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Usage
|
|
53
|
+
|
|
54
|
+
Run it from inside any git repository you write in:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
draftwatch draft.md
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Or to start with a specific file:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
draftwatch draft.md
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Draftwatch opens a two-panel review window: your source on the left (a real editor with markdown highlighting, search, and a live preview), the diff against your baseline on the right. Review the changes, revert the ones you don't want, apply, then commit. Committing advances the baseline, so the next agent pass starts clean.
|
|
67
|
+
|
|
68
|
+
Start without a file (`draftwatch`) to pick one in the window.
|
|
69
|
+
|
|
70
|
+
### Options
|
|
71
|
+
|
|
72
|
+
```
|
|
73
|
+
draftwatch [target] [--port 8787] [--host 127.0.0.1] [--no-open] [--app | --no-app]
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
- `target`: file to watch. Optional; omit it to pick one in the UI.
|
|
77
|
+
- `--port`: default `8787`.
|
|
78
|
+
- `--host`: default `127.0.0.1`. Changing this exposes the tool on your network and is not recommended.
|
|
79
|
+
- `--no-open`: don't auto-open a window (useful headless or over SSH).
|
|
80
|
+
- `--app` / `--no-app`: force or disable the native window. It is on by default when pywebview is installed and falls back to the browser otherwise.
|
|
81
|
+
|
|
82
|
+
## Features
|
|
83
|
+
|
|
84
|
+
- Real git word-diffs, so what you see is exactly what git sees.
|
|
85
|
+
- Keep or revert changes one hunk at a time, or all at once, then commit from the UI.
|
|
86
|
+
- Switchable baseline: last push, HEAD, or an earlier commit.
|
|
87
|
+
- Jump between changes or collapse to a changes-only view for long documents.
|
|
88
|
+
- Editable markdown preview alongside the raw source.
|
|
89
|
+
- You and the agent can both edit; your unsaved work is never clobbered when the file changes on disk.
|
|
90
|
+
|
|
91
|
+
## Security
|
|
92
|
+
|
|
93
|
+
Draftwatch binds `127.0.0.1` only. Every request carries a per-session token, the Host and Origin headers are validated to defeat DNS-rebinding, and the markdown preview is sanitized with DOMPurify before rendering. The tool never talks to any LLM. Don't change `--host` unless you understand the exposure.
|
|
94
|
+
|
|
95
|
+
## Tests
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
python3 testing/test_reconstruct.py # reconstruction invariants
|
|
99
|
+
python3 testing/test_acceptance.py # end-to-end server tests
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Development
|
|
103
|
+
|
|
104
|
+
The front-end libraries are vendored into `draftwatch/assets/` and committed, so end users never need Node. To rebuild them: `npm install && npm run build:vendor`.
|
|
105
|
+
|
|
106
|
+
## Author
|
|
107
|
+
|
|
108
|
+
Built by Mike Konczal. Vibe-coded with Fable 5.
|
|
109
|
+
|
|
110
|
+
## License
|
|
111
|
+
|
|
112
|
+
MIT. See `LICENSE`.
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# Draftwatch
|
|
2
|
+
|
|
3
|
+
Draftwatch is a lightweight IDE for writers that all them to review an AI agent's edits to their writing the way you'd review a pull request. Draftwatch shows the exact, git-backed word-diff of what changed in a file, lets you keep or revert each change, and commits when you're done.
|
|
4
|
+
|
|
5
|
+
The diff comes from git on your machine, not from the AI vendor and not from a JavaScript approximation. You get independent verification of what the agent actually did.
|
|
6
|
+
|
|
7
|
+
Python 3.9+ and git are the only requirements. The front-end libraries (CodeMirror 6, marked, DOMPurify, Turndown) are vendored and served locally, so it works offline and binds to localhost only.
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
Install straight from GitHub, no clone needed:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
# uv (recommended): run without installing
|
|
15
|
+
uvx --from git+https://github.com/mtkonczal/Draftwatch.git draftwatch draft.md
|
|
16
|
+
|
|
17
|
+
# pipx: install the `draftwatch` command onto your PATH
|
|
18
|
+
pipx install git+https://github.com/mtkonczal/Draftwatch.git
|
|
19
|
+
|
|
20
|
+
# pip
|
|
21
|
+
pip install git+https://github.com/mtkonczal/Draftwatch.git
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
For the native app window, add the `app` extra:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
pipx install "draftwatch[app] @ git+https://github.com/mtkonczal/Draftwatch.git"
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Usage
|
|
31
|
+
|
|
32
|
+
Run it from inside any git repository you write in:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
draftwatch draft.md
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Or to start with a specific file:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
draftwatch draft.md
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Draftwatch opens a two-panel review window: your source on the left (a real editor with markdown highlighting, search, and a live preview), the diff against your baseline on the right. Review the changes, revert the ones you don't want, apply, then commit. Committing advances the baseline, so the next agent pass starts clean.
|
|
45
|
+
|
|
46
|
+
Start without a file (`draftwatch`) to pick one in the window.
|
|
47
|
+
|
|
48
|
+
### Options
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
draftwatch [target] [--port 8787] [--host 127.0.0.1] [--no-open] [--app | --no-app]
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
- `target`: file to watch. Optional; omit it to pick one in the UI.
|
|
55
|
+
- `--port`: default `8787`.
|
|
56
|
+
- `--host`: default `127.0.0.1`. Changing this exposes the tool on your network and is not recommended.
|
|
57
|
+
- `--no-open`: don't auto-open a window (useful headless or over SSH).
|
|
58
|
+
- `--app` / `--no-app`: force or disable the native window. It is on by default when pywebview is installed and falls back to the browser otherwise.
|
|
59
|
+
|
|
60
|
+
## Features
|
|
61
|
+
|
|
62
|
+
- Real git word-diffs, so what you see is exactly what git sees.
|
|
63
|
+
- Keep or revert changes one hunk at a time, or all at once, then commit from the UI.
|
|
64
|
+
- Switchable baseline: last push, HEAD, or an earlier commit.
|
|
65
|
+
- Jump between changes or collapse to a changes-only view for long documents.
|
|
66
|
+
- Editable markdown preview alongside the raw source.
|
|
67
|
+
- You and the agent can both edit; your unsaved work is never clobbered when the file changes on disk.
|
|
68
|
+
|
|
69
|
+
## Security
|
|
70
|
+
|
|
71
|
+
Draftwatch binds `127.0.0.1` only. Every request carries a per-session token, the Host and Origin headers are validated to defeat DNS-rebinding, and the markdown preview is sanitized with DOMPurify before rendering. The tool never talks to any LLM. Don't change `--host` unless you understand the exposure.
|
|
72
|
+
|
|
73
|
+
## Tests
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
python3 testing/test_reconstruct.py # reconstruction invariants
|
|
77
|
+
python3 testing/test_acceptance.py # end-to-end server tests
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Development
|
|
81
|
+
|
|
82
|
+
The front-end libraries are vendored into `draftwatch/assets/` and committed, so end users never need Node. To rebuild them: `npm install && npm run build:vendor`.
|
|
83
|
+
|
|
84
|
+
## Author
|
|
85
|
+
|
|
86
|
+
Built by Mike Konczal. Vibe-coded with Fable 5.
|
|
87
|
+
|
|
88
|
+
## License
|
|
89
|
+
|
|
90
|
+
MIT. See `LICENSE`.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"""draftwatch — review an AI agent's edits to your writing as a real git word-diff.
|
|
2
|
+
|
|
3
|
+
The diff is produced by git on your machine, never by the AI vendor: independent
|
|
4
|
+
verification of what the agent changed, with hunk-by-hunk keep/revert and a
|
|
5
|
+
commit loop.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from .app import * # noqa: F401,F403 (re-export the engine for tests/embedding)
|
|
9
|
+
from .app import main, __version__ # noqa: F401 (version lives in app.py, single source)
|