Skip to content

Commit b9fc155

Browse files
committed
feat: add on-device summarization helper
1 parent b7c57fe commit b9fc155

File tree

7 files changed

+72
-8
lines changed

7 files changed

+72
-8
lines changed

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,22 @@ All notable changes to ClipDrop will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [1.6.0] - 2025-09-30
9+
10+
### ✨ Summaries on macOS 26.0+
11+
12+
### Added
13+
- On-device summarization helper powered by Apple Intelligence foundation models
14+
- `--summarize` / `-S` CLI flag to append AI summaries to saved text
15+
- Eligibility checks for content length, format, and platform availability
16+
- Build automation for `clipdrop-summarize` universal binary and Python bridge tests
17+
18+
### Changed
19+
- README/usage docs now highlight summarization workflows and requirements
20+
- Version bumped to 1.6.0
21+
22+
---
23+
824
## [1.5.3] - 2025-09-23
925

1026
### 🐛 Bug Fixes

README.md

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,25 @@ clipdrop # → transcript_20240323_143022.srt
6767
clipdrop meeting.txt # → meeting notes as plain text
6868
```
6969

70-
### 4. 🎥 **YouTube Transcripts**
70+
### 4. 🤖 **On-Device Summaries** (macOS 26.0+)
71+
Turn long clipboard text into concise takeaways without leaving your machine:
72+
```bash
73+
# Save article and append summary
74+
clipdrop research-notes.md --summarize
75+
76+
# Skip when content is too short or non-text
77+
clipdrop notes.txt --summarize
78+
```
79+
80+
### 5. 🎥 **YouTube Transcripts**
7181
Research videos efficiently:
7282
```bash
7383
# Copy YouTube URL, then:
7484
clipdrop -yt # Download transcript
7585
clipdrop -yt lecture.md --lang es # Spanish transcript
7686
```
7787

78-
### 5. 🔒 **Secret Scanner**
88+
### 6. 🔒 **Secret Scanner**
7989
Never accidentally save credentials:
8090
```bash
8191
clipdrop config.env -s # Scan before saving
@@ -127,6 +137,9 @@ clipdrop -yt lecture.md
127137

128138
# Build research document
129139
clipdrop research.md -a
140+
141+
# Append AI summary (macOS 26.0+)
142+
clipdrop research.md --summarize
130143
```
131144
</details>
132145

@@ -229,4 +242,4 @@ MIT © [Prateek Jain](https://github.com/prateekjain24)
229242
<p align="center">
230243
<b>Stop copying and pasting. Start ClipDropping.</b><br>
231244
<sub>Made with ❤️ for the clipboard warriors</sub>
232-
</p>
245+
</p>

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "clipdrop"
3-
version = "1.5.3"
3+
version = "1.6.0"
44
description = "Save clipboard content (text and images) to files with smart format detection"
55
readme = "README.md"
66
authors = [

src/clipdrop/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
"""ClipDrop - Save clipboard content (text and images) to files with smart format detection."""
22

3-
__version__ = "1.5.3"
3+
__version__ = "1.6.0"
113 KB
Binary file not shown.

src/clipdrop/detect.py

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,30 @@ def is_summarizable_content(content: str, detected_format: str) -> tuple[bool, s
2626
return False, "Content too long for single-pass summarization"
2727

2828
# Heuristic filter to avoid passing obvious code snippets.
29-
code_indicators = ("def ", "class ", "function ", "#!/", "import ", "from ")
3029
lowered = content.lower()
31-
if any(indicator in lowered for indicator in code_indicators):
30+
code_keywords = (
31+
"def ",
32+
" class ",
33+
"function ",
34+
"fn ",
35+
"#!/",
36+
"import ",
37+
"const ",
38+
" var ",
39+
"public ",
40+
"private ",
41+
)
42+
code_hits = sum(lowered.count(keyword) for keyword in code_keywords)
43+
fenced_code = "```" in content or "</code>" in lowered
44+
indented_code = any(
45+
line.startswith((" ", "\t")) and any(sym in line for sym in ("(", ")", "=", ":"))
46+
for line in content.splitlines()
47+
)
48+
structural_tokens = any(token in content for token in ("{", "};", "=>", "#include"))
49+
50+
if fenced_code or code_hits >= 3 or (
51+
code_hits >= 2 and (indented_code or structural_tokens)
52+
):
3253
return False, "Content appears to be code"
3354

3455
if normalized_format in {"md", "markdown", "txt", "text", "html"}:

usage.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ clipdrop log.txt # Save as text file
5151
|------|-------------|---------|
5252
| `--lang CODE` | Language for transcripts | `clipdrop -yt --lang es` |
5353
| `--chapters` | Include YouTube chapter markers | `clipdrop -yt video.md --chapters` |
54+
| `--summarize` | `-S` | Append AI summary after saving (macOS 26.0+) | `clipdrop notes.md --summarize` |
5455
| `--version` | Show version | `clipdrop --version` |
5556
| `--help` | Show help | `clipdrop --help` |
5657

@@ -158,6 +159,19 @@ clipdrop output.txt -f
158159
# Accept all security prompts
159160
clipdrop data.json --scan -y
160161

162+
### 9. AI Summaries (macOS 26.0+)
163+
Generate a quick recap of long clipboard text:
164+
```bash
165+
# Save and summarize in one step
166+
clipdrop article.md --summarize
167+
168+
# Works with existing files too
169+
clipdrop notes.txt --summarize
170+
171+
# Summaries are skipped for short or non-text content
172+
clipdrop changelog.txt --summarize
173+
```
174+
161175
# Combine flags for full automation
162176
clipdrop log.txt -a -f -y
163177
```
@@ -345,4 +359,4 @@ curl api.example.com | pbcopy && clipdrop response.json
345359

346360
---
347361

348-
For more information, visit: https://github.com/prateekjain24/clipdrop
362+
For more information, visit: https://github.com/prateekjain24/clipdrop

0 commit comments

Comments
 (0)