draftwatch 0.1.1__tar.gz → 0.2.1__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.2.1/PKG-INFO +111 -0
- draftwatch-0.2.1/README.md +89 -0
- {draftwatch-0.1.1 → draftwatch-0.2.1}/draftwatch/app.py +460 -26
- draftwatch-0.2.1/draftwatch/assets/xterm.css +218 -0
- draftwatch-0.2.1/draftwatch/assets/xterm.js +9 -0
- draftwatch-0.2.1/draftwatch/term.py +246 -0
- draftwatch-0.2.1/draftwatch.egg-info/PKG-INFO +111 -0
- {draftwatch-0.1.1 → draftwatch-0.2.1}/draftwatch.egg-info/SOURCES.txt +4 -1
- {draftwatch-0.1.1 → draftwatch-0.2.1}/pyproject.toml +1 -1
- draftwatch-0.1.1/PKG-INFO +0 -119
- draftwatch-0.1.1/README.md +0 -97
- draftwatch-0.1.1/draftwatch.egg-info/PKG-INFO +0 -119
- {draftwatch-0.1.1 → draftwatch-0.2.1}/LICENSE +0 -0
- {draftwatch-0.1.1 → draftwatch-0.2.1}/draftwatch/__init__.py +0 -0
- {draftwatch-0.1.1 → draftwatch-0.2.1}/draftwatch/__main__.py +0 -0
- {draftwatch-0.1.1 → draftwatch-0.2.1}/draftwatch/assets/codemirror.js +0 -0
- {draftwatch-0.1.1 → draftwatch-0.2.1}/draftwatch/assets/marked.js +0 -0
- {draftwatch-0.1.1 → draftwatch-0.2.1}/draftwatch/assets/purify.js +0 -0
- {draftwatch-0.1.1 → draftwatch-0.2.1}/draftwatch/assets/turndown.js +0 -0
- {draftwatch-0.1.1 → draftwatch-0.2.1}/draftwatch.egg-info/dependency_links.txt +0 -0
- {draftwatch-0.1.1 → draftwatch-0.2.1}/draftwatch.egg-info/entry_points.txt +0 -0
- {draftwatch-0.1.1 → draftwatch-0.2.1}/draftwatch.egg-info/requires.txt +0 -0
- {draftwatch-0.1.1 → draftwatch-0.2.1}/draftwatch.egg-info/top_level.txt +0 -0
- {draftwatch-0.1.1 → draftwatch-0.2.1}/setup.cfg +0 -0
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: draftwatch
|
|
3
|
+
Version: 0.2.1
|
|
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
|
+

|
|
26
|
+
|
|
27
|
+
It’s difficult for writers to have AI act as an editor, because it’s never clear exactly what it changed. You can’t trust eyeballing it, but making the changes manually yourself means you don’t save much time. So you either ignore this potentially powerful writing helper, or you trust it at the risk that it does far more than you asked.
|
|
28
|
+
|
|
29
|
+
Enter Draftwatch. Draftwatch is a lightweight editing tool for writers. You can use it to create and format new Markdown documents from scratch, but its more powerful use is reviewing an AI agent's edits to your writing, down to the exact word. Changes are managed by git, the way a developer reviews changes to their code, but formatted for writers who need to see each exact word change to feel comfortable.
|
|
30
|
+
|
|
31
|
+
When reviewing AI edits, instead of guessing what an LLM changed in your document, Draftwatch shows you the exact, git-backed word-diff. You can step through, keep or revert each change individually, and commit when you're done.
|
|
32
|
+
|
|
33
|
+
The diff comes from your local git, not from the AI vendor and not from a JavaScript approximation. You get independent verification of what the agent or script actually did.
|
|
34
|
+
|
|
35
|
+
Why this vibe-coded app? I designed it to be an Integrated Development Environment (IDE) for writers. Most IDEs show `git diff` at the line level, which is appropriate for coders (where each statement is generally its own line) but terrible for writers, who work at the paragraph level. This IDE is built around displaying `git diff --word-diff=porcelain`, which lets writers see the specific words being edited. Even the IDEs that do show this make it harder for writers to track edits, and they carry coding features and visual baggage that writers won’t need.
|
|
36
|
+
|
|
37
|
+
Python 3.9+ and git are the only requirements. If you are a writer, AI itself can help you install these widely used tools. The front-end libraries (CodeMirror 6, marked, DOMPurify, Turndown, xterm.js) are vendored and served locally, so Draftwatch works completely offline and binds to your local computer.
|
|
38
|
+
|
|
39
|
+
## Install
|
|
40
|
+
|
|
41
|
+
Draftwatch is available on PyPI. You can install or run it using your preferred Python package manager:
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
# pipx
|
|
45
|
+
pipx install draftwatch
|
|
46
|
+
|
|
47
|
+
# uv
|
|
48
|
+
uv tool install draftwatch
|
|
49
|
+
|
|
50
|
+
# standard pip
|
|
51
|
+
pip install draftwatch
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Usage
|
|
55
|
+
|
|
56
|
+
Run it from inside a git repository you write in:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
draftwatch
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Or to start with a specific file:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
draftwatch draft.md
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
You can also run it outside any git repository. Draftwatch starts in **write-only mode**: the editor, preview, and saving all work, but the review loop (diffs, revert, commit) is off because there's no git to compare against. The right panel offers a one-click **initialize git here** to turn the folder into a repo and switch on the full review loop.
|
|
69
|
+
|
|
70
|
+
Starting a second instance while one is already running just works: if the default port is busy, Draftwatch picks a free one and prints the URL.
|
|
71
|
+
|
|
72
|
+
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.
|
|
73
|
+
|
|
74
|
+
Start without a file (`draftwatch`) to pick one in the window.
|
|
75
|
+
|
|
76
|
+
## The terminal panel
|
|
77
|
+
|
|
78
|
+
Click **terminal** in the toolbar to open a third panel running a real shell in your repo (macOS/Linux). Launch `claude`, `codex`, or any command there: when the agent edits the file you're watching, the diff panel lights up live: prompt on the right, review in the middle, write on the left. **hide** collapses the panel and leaves the shell running (an agent mid-task keeps working); **end session** kills the shell and everything it started. No snapshots are taken when you run commands; edits accumulate against whatever baseline you've selected, and you review them on your schedule. On Windows the panel is unavailable and Draftwatch runs without it.
|
|
79
|
+
|
|
80
|
+
## Features
|
|
81
|
+
|
|
82
|
+
- Real git word-diffs, so what you see is exactly what git sees.
|
|
83
|
+
- Keep or revert changes one hunk at a time, or all at once, then commit from the UI.
|
|
84
|
+
- Switchable baseline: last push, HEAD, or an earlier commit.
|
|
85
|
+
- Jump between changes or collapse to a changes-only view for long documents.
|
|
86
|
+
- Editable markdown preview alongside the raw source.
|
|
87
|
+
- You and the agent can both edit; your unsaved work is never clobbered when the file changes on disk.
|
|
88
|
+
- Embedded terminal panel (macOS/Linux): run your agent next to the diff without leaving the window.
|
|
89
|
+
- Resizable panels: drag the dividers to change the split (double-click to reset).
|
|
90
|
+
|
|
91
|
+
### Options
|
|
92
|
+
|
|
93
|
+
```
|
|
94
|
+
draftwatch [target] [--port 8787] [--no-open] [--no-terminal] [--app | --no-app]
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
- `target`: file to watch. Optional; omit it to pick one in the UI.
|
|
98
|
+
- `--port`: default `8787`. If omitted and the default is busy, Draftwatch
|
|
99
|
+
picks a free port automatically; pass `--port` to pin an exact one (it then
|
|
100
|
+
fails loudly if that port is taken).
|
|
101
|
+
- `--no-open`: don't auto-open a window (useful headless or over SSH).
|
|
102
|
+
- `--no-terminal`: disable the embedded terminal panel entirely (its routes are removed from the server, not just hidden in the UI).
|
|
103
|
+
- `--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.
|
|
104
|
+
|
|
105
|
+
## Author
|
|
106
|
+
|
|
107
|
+
Built by Mike Konczal. You can find out more about me at my webpage [here](https://www.mikekonczal.com/). Vibe-coded with Fable 5.
|
|
108
|
+
|
|
109
|
+
## License
|
|
110
|
+
|
|
111
|
+
MIT. See `LICENSE`.
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# Draftwatch
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
It’s difficult for writers to have AI act as an editor, because it’s never clear exactly what it changed. You can’t trust eyeballing it, but making the changes manually yourself means you don’t save much time. So you either ignore this potentially powerful writing helper, or you trust it at the risk that it does far more than you asked.
|
|
6
|
+
|
|
7
|
+
Enter Draftwatch. Draftwatch is a lightweight editing tool for writers. You can use it to create and format new Markdown documents from scratch, but its more powerful use is reviewing an AI agent's edits to your writing, down to the exact word. Changes are managed by git, the way a developer reviews changes to their code, but formatted for writers who need to see each exact word change to feel comfortable.
|
|
8
|
+
|
|
9
|
+
When reviewing AI edits, instead of guessing what an LLM changed in your document, Draftwatch shows you the exact, git-backed word-diff. You can step through, keep or revert each change individually, and commit when you're done.
|
|
10
|
+
|
|
11
|
+
The diff comes from your local git, not from the AI vendor and not from a JavaScript approximation. You get independent verification of what the agent or script actually did.
|
|
12
|
+
|
|
13
|
+
Why this vibe-coded app? I designed it to be an Integrated Development Environment (IDE) for writers. Most IDEs show `git diff` at the line level, which is appropriate for coders (where each statement is generally its own line) but terrible for writers, who work at the paragraph level. This IDE is built around displaying `git diff --word-diff=porcelain`, which lets writers see the specific words being edited. Even the IDEs that do show this make it harder for writers to track edits, and they carry coding features and visual baggage that writers won’t need.
|
|
14
|
+
|
|
15
|
+
Python 3.9+ and git are the only requirements. If you are a writer, AI itself can help you install these widely used tools. The front-end libraries (CodeMirror 6, marked, DOMPurify, Turndown, xterm.js) are vendored and served locally, so Draftwatch works completely offline and binds to your local computer.
|
|
16
|
+
|
|
17
|
+
## Install
|
|
18
|
+
|
|
19
|
+
Draftwatch is available on PyPI. You can install or run it using your preferred Python package manager:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
# pipx
|
|
23
|
+
pipx install draftwatch
|
|
24
|
+
|
|
25
|
+
# uv
|
|
26
|
+
uv tool install draftwatch
|
|
27
|
+
|
|
28
|
+
# standard pip
|
|
29
|
+
pip install draftwatch
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Usage
|
|
33
|
+
|
|
34
|
+
Run it from inside a git repository you write in:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
draftwatch
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Or to start with a specific file:
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
draftwatch draft.md
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
You can also run it outside any git repository. Draftwatch starts in **write-only mode**: the editor, preview, and saving all work, but the review loop (diffs, revert, commit) is off because there's no git to compare against. The right panel offers a one-click **initialize git here** to turn the folder into a repo and switch on the full review loop.
|
|
47
|
+
|
|
48
|
+
Starting a second instance while one is already running just works: if the default port is busy, Draftwatch picks a free one and prints the URL.
|
|
49
|
+
|
|
50
|
+
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.
|
|
51
|
+
|
|
52
|
+
Start without a file (`draftwatch`) to pick one in the window.
|
|
53
|
+
|
|
54
|
+
## The terminal panel
|
|
55
|
+
|
|
56
|
+
Click **terminal** in the toolbar to open a third panel running a real shell in your repo (macOS/Linux). Launch `claude`, `codex`, or any command there: when the agent edits the file you're watching, the diff panel lights up live: prompt on the right, review in the middle, write on the left. **hide** collapses the panel and leaves the shell running (an agent mid-task keeps working); **end session** kills the shell and everything it started. No snapshots are taken when you run commands; edits accumulate against whatever baseline you've selected, and you review them on your schedule. On Windows the panel is unavailable and Draftwatch runs without it.
|
|
57
|
+
|
|
58
|
+
## Features
|
|
59
|
+
|
|
60
|
+
- Real git word-diffs, so what you see is exactly what git sees.
|
|
61
|
+
- Keep or revert changes one hunk at a time, or all at once, then commit from the UI.
|
|
62
|
+
- Switchable baseline: last push, HEAD, or an earlier commit.
|
|
63
|
+
- Jump between changes or collapse to a changes-only view for long documents.
|
|
64
|
+
- Editable markdown preview alongside the raw source.
|
|
65
|
+
- You and the agent can both edit; your unsaved work is never clobbered when the file changes on disk.
|
|
66
|
+
- Embedded terminal panel (macOS/Linux): run your agent next to the diff without leaving the window.
|
|
67
|
+
- Resizable panels: drag the dividers to change the split (double-click to reset).
|
|
68
|
+
|
|
69
|
+
### Options
|
|
70
|
+
|
|
71
|
+
```
|
|
72
|
+
draftwatch [target] [--port 8787] [--no-open] [--no-terminal] [--app | --no-app]
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
- `target`: file to watch. Optional; omit it to pick one in the UI.
|
|
76
|
+
- `--port`: default `8787`. If omitted and the default is busy, Draftwatch
|
|
77
|
+
picks a free port automatically; pass `--port` to pin an exact one (it then
|
|
78
|
+
fails loudly if that port is taken).
|
|
79
|
+
- `--no-open`: don't auto-open a window (useful headless or over SSH).
|
|
80
|
+
- `--no-terminal`: disable the embedded terminal panel entirely (its routes are removed from the server, not just hidden in the UI).
|
|
81
|
+
- `--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.
|
|
82
|
+
|
|
83
|
+
## Author
|
|
84
|
+
|
|
85
|
+
Built by Mike Konczal. You can find out more about me at my webpage [here](https://www.mikekonczal.com/). Vibe-coded with Fable 5.
|
|
86
|
+
|
|
87
|
+
## License
|
|
88
|
+
|
|
89
|
+
MIT. See `LICENSE`.
|