draftwatch 0.1.1__tar.gz → 0.2.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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: draftwatch
3
- Version: 0.1.1
3
+ Version: 0.2.0
4
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
5
  Author: Mike Konczal
6
6
  License: MIT
@@ -28,7 +28,7 @@ When reviewing AI edits, instead of guessing what an LLM changed in your documen
28
28
 
29
29
  Crucially, the diff comes from your local git—not from the AI vendor and not from a JavaScript approximation. You get absolute, independent verification of what the agent or script actually did.
30
30
 
31
- Python 3.9+ and git are the only requirements. The front-end libraries (CodeMirror 6, marked, DOMPurify, Turndown) are vendored and served locally, so Draftwatch works completely offline and binds to localhost only.
31
+ Python 3.9+ and git are the only requirements. The front-end libraries (CodeMirror 6, marked, DOMPurify, Turndown, xterm.js) are vendored and served locally, so Draftwatch works completely offline and binds to localhost only.
32
32
 
33
33
  ## Install
34
34
 
@@ -75,17 +75,21 @@ Start without a file (`draftwatch`) to pick one in the window.
75
75
  ### Options
76
76
 
77
77
  ```
78
- draftwatch [target] [--port 8787] [--host 127.0.0.1] [--no-open] [--app | --no-app]
78
+ draftwatch [target] [--port 8787] [--no-open] [--no-terminal] [--app | --no-app]
79
79
  ```
80
80
 
81
81
  - `target`: file to watch. Optional; omit it to pick one in the UI.
82
82
  - `--port`: default `8787`. If omitted and the default is busy, Draftwatch
83
83
  picks a free port automatically; pass `--port` to pin an exact one (it then
84
84
  fails loudly if that port is taken).
85
- - `--host`: default `127.0.0.1`. Changing this exposes the tool on your network and is not recommended.
86
85
  - `--no-open`: don't auto-open a window (useful headless or over SSH).
86
+ - `--no-terminal`: disable the embedded terminal panel entirely (its routes are removed from the server, not just hidden in the UI).
87
87
  - `--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.
88
88
 
89
+ ## The terminal panel
90
+
91
+ 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 simply runs without it.
92
+
89
93
  ## Features
90
94
 
91
95
  - Real git word-diffs, so what you see is exactly what git sees.
@@ -94,10 +98,14 @@ draftwatch [target] [--port 8787] [--host 127.0.0.1] [--no-open] [--app | --no-a
94
98
  - Jump between changes or collapse to a changes-only view for long documents.
95
99
  - Editable markdown preview alongside the raw source.
96
100
  - You and the agent can both edit; your unsaved work is never clobbered when the file changes on disk.
101
+ - Embedded terminal panel (macOS/Linux): run your agent next to the diff without leaving the window.
102
+ - Resizable panels: drag the dividers to change the split (double-click to reset).
97
103
 
98
104
  ## Security
99
105
 
100
- 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.
106
+ Draftwatch binds `127.0.0.1` only — there is deliberately no option to bind another interface, so the tool is never exposed on your network. 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.
107
+
108
+ The terminal panel is a real shell, so it gets extra care: its input routes accept the session token **only** as a request header (keystrokes never appear in URLs, browser history, or logs), the server pipes bytes to the PTY without ever parsing them, ending a session kills the shell's whole process group, and no shell outlives Draftwatch. `--no-terminal` removes the feature from the server entirely.
101
109
 
102
110
  ## Tests
103
111
 
@@ -6,7 +6,7 @@ When reviewing AI edits, instead of guessing what an LLM changed in your documen
6
6
 
7
7
  Crucially, the diff comes from your local git—not from the AI vendor and not from a JavaScript approximation. You get absolute, independent verification of what the agent or script actually did.
8
8
 
9
- Python 3.9+ and git are the only requirements. The front-end libraries (CodeMirror 6, marked, DOMPurify, Turndown) are vendored and served locally, so Draftwatch works completely offline and binds to localhost only.
9
+ Python 3.9+ and git are the only requirements. The front-end libraries (CodeMirror 6, marked, DOMPurify, Turndown, xterm.js) are vendored and served locally, so Draftwatch works completely offline and binds to localhost only.
10
10
 
11
11
  ## Install
12
12
 
@@ -53,17 +53,21 @@ Start without a file (`draftwatch`) to pick one in the window.
53
53
  ### Options
54
54
 
55
55
  ```
56
- draftwatch [target] [--port 8787] [--host 127.0.0.1] [--no-open] [--app | --no-app]
56
+ draftwatch [target] [--port 8787] [--no-open] [--no-terminal] [--app | --no-app]
57
57
  ```
58
58
 
59
59
  - `target`: file to watch. Optional; omit it to pick one in the UI.
60
60
  - `--port`: default `8787`. If omitted and the default is busy, Draftwatch
61
61
  picks a free port automatically; pass `--port` to pin an exact one (it then
62
62
  fails loudly if that port is taken).
63
- - `--host`: default `127.0.0.1`. Changing this exposes the tool on your network and is not recommended.
64
63
  - `--no-open`: don't auto-open a window (useful headless or over SSH).
64
+ - `--no-terminal`: disable the embedded terminal panel entirely (its routes are removed from the server, not just hidden in the UI).
65
65
  - `--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.
66
66
 
67
+ ## The terminal panel
68
+
69
+ 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 simply runs without it.
70
+
67
71
  ## Features
68
72
 
69
73
  - Real git word-diffs, so what you see is exactly what git sees.
@@ -72,10 +76,14 @@ draftwatch [target] [--port 8787] [--host 127.0.0.1] [--no-open] [--app | --no-a
72
76
  - Jump between changes or collapse to a changes-only view for long documents.
73
77
  - Editable markdown preview alongside the raw source.
74
78
  - You and the agent can both edit; your unsaved work is never clobbered when the file changes on disk.
79
+ - Embedded terminal panel (macOS/Linux): run your agent next to the diff without leaving the window.
80
+ - Resizable panels: drag the dividers to change the split (double-click to reset).
75
81
 
76
82
  ## Security
77
83
 
78
- 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.
84
+ Draftwatch binds `127.0.0.1` only — there is deliberately no option to bind another interface, so the tool is never exposed on your network. 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.
85
+
86
+ The terminal panel is a real shell, so it gets extra care: its input routes accept the session token **only** as a request header (keystrokes never appear in URLs, browser history, or logs), the server pipes bytes to the PTY without ever parsing them, ending a session kills the shell's whole process group, and no shell outlives Draftwatch. `--no-terminal` removes the feature from the server entirely.
79
87
 
80
88
  ## Tests
81
89