trnscrb 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.
- trnscrb-0.1.0/LICENSE +21 -0
- trnscrb-0.1.0/PKG-INFO +165 -0
- trnscrb-0.1.0/README.md +109 -0
- trnscrb-0.1.0/pyproject.toml +52 -0
- trnscrb-0.1.0/setup.cfg +4 -0
- trnscrb-0.1.0/trnscrb/__init__.py +1 -0
- trnscrb-0.1.0/trnscrb/calendar_integration.py +59 -0
- trnscrb-0.1.0/trnscrb/cli.py +545 -0
- trnscrb-0.1.0/trnscrb/diarizer.py +43 -0
- trnscrb-0.1.0/trnscrb/enricher.py +95 -0
- trnscrb-0.1.0/trnscrb/icon.py +80 -0
- trnscrb-0.1.0/trnscrb/mcp_server.py +260 -0
- trnscrb-0.1.0/trnscrb/menu_bar.py +240 -0
- trnscrb-0.1.0/trnscrb/recorder.py +88 -0
- trnscrb-0.1.0/trnscrb/settings.py +34 -0
- trnscrb-0.1.0/trnscrb/storage.py +73 -0
- trnscrb-0.1.0/trnscrb/transcriber.py +47 -0
- trnscrb-0.1.0/trnscrb/watcher.py +442 -0
- trnscrb-0.1.0/trnscrb.egg-info/PKG-INFO +165 -0
- trnscrb-0.1.0/trnscrb.egg-info/SOURCES.txt +22 -0
- trnscrb-0.1.0/trnscrb.egg-info/dependency_links.txt +1 -0
- trnscrb-0.1.0/trnscrb.egg-info/entry_points.txt +2 -0
- trnscrb-0.1.0/trnscrb.egg-info/requires.txt +9 -0
- trnscrb-0.1.0/trnscrb.egg-info/top_level.txt +1 -0
trnscrb-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Ajay Ram
|
|
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.
|
trnscrb-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: trnscrb
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Offline meeting transcription for macOS — auto-detects meetings, transcribes locally, saves to Claude Desktop via MCP
|
|
5
|
+
Author-email: Ajay Ram <ajayrmk@gmail.com>
|
|
6
|
+
License: MIT License
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2025 Ajay Ram
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in all
|
|
18
|
+
copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
+
SOFTWARE.
|
|
27
|
+
|
|
28
|
+
Project-URL: Homepage, https://github.com/ajayrmk/trnscrb
|
|
29
|
+
Project-URL: Repository, https://github.com/ajayrmk/trnscrb
|
|
30
|
+
Project-URL: Bug Tracker, https://github.com/ajayrmk/trnscrb/issues
|
|
31
|
+
Keywords: transcription,meeting,whisper,macos,mcp,claude,offline
|
|
32
|
+
Classifier: Development Status :: 4 - Beta
|
|
33
|
+
Classifier: Environment :: MacOS X
|
|
34
|
+
Classifier: Intended Audience :: End Users/Desktop
|
|
35
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
36
|
+
Classifier: Operating System :: MacOS
|
|
37
|
+
Classifier: Programming Language :: Python :: 3
|
|
38
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
39
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
40
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
41
|
+
Classifier: Topic :: Multimedia :: Sound/Audio :: Speech
|
|
42
|
+
Classifier: Topic :: Office/Business
|
|
43
|
+
Requires-Python: >=3.11
|
|
44
|
+
Description-Content-Type: text/markdown
|
|
45
|
+
License-File: LICENSE
|
|
46
|
+
Requires-Dist: rumps>=0.4.0
|
|
47
|
+
Requires-Dist: sounddevice>=0.4.6
|
|
48
|
+
Requires-Dist: numpy>=1.24
|
|
49
|
+
Requires-Dist: faster-whisper>=1.0.0
|
|
50
|
+
Requires-Dist: pyannote.audio>=3.1
|
|
51
|
+
Requires-Dist: mcp>=1.0.0
|
|
52
|
+
Requires-Dist: click>=8.1
|
|
53
|
+
Requires-Dist: anthropic>=0.25
|
|
54
|
+
Requires-Dist: scipy>=1.11
|
|
55
|
+
Dynamic: license-file
|
|
56
|
+
|
|
57
|
+
# trnscrb
|
|
58
|
+
|
|
59
|
+
Lightweight, fully offline meeting transcription for Claude Desktop.
|
|
60
|
+
A native macOS alternative to Granola — no cloud, no subscription.
|
|
61
|
+
|
|
62
|
+
## What it does
|
|
63
|
+
|
|
64
|
+
- Auto-detects meetings (Google Meet, Zoom, Slack Huddle, Teams, and more)
|
|
65
|
+
- Records your meeting audio (mic + system audio via BlackHole)
|
|
66
|
+
- Transcribes locally with Whisper (`small` model, Apple Silicon Metal)
|
|
67
|
+
- Identifies speakers with pyannote diarization
|
|
68
|
+
- Reads your calendar to auto-name meetings
|
|
69
|
+
- Saves every transcript as a plain `.txt` file in `~/meeting-notes/`
|
|
70
|
+
- Exposes everything to Claude Desktop via MCP so Claude can search, read, and enrich your notes
|
|
71
|
+
|
|
72
|
+
## Requirements
|
|
73
|
+
|
|
74
|
+
- macOS 13+
|
|
75
|
+
- Python 3.11+
|
|
76
|
+
- Apple Silicon recommended (M1/M2/M3) for fast local transcription
|
|
77
|
+
|
|
78
|
+
## Install
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
# One-liner bootstrap:
|
|
82
|
+
bash <(curl -fsSL https://raw.githubusercontent.com/ajayrmk/trnscrb/main/install.sh)
|
|
83
|
+
|
|
84
|
+
# Or if already cloned:
|
|
85
|
+
trnscrb install
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
The installer checks and optionally installs:
|
|
89
|
+
- BlackHole 2ch audio driver (via Homebrew)
|
|
90
|
+
- Python packages (faster-whisper, pyannote, rumps, sounddevice, mcp, …)
|
|
91
|
+
- HuggingFace token (for pyannote speaker diarization)
|
|
92
|
+
- Whisper `small` model (~500 MB, downloaded once)
|
|
93
|
+
- Claude Desktop MCP config entry
|
|
94
|
+
- Launch-at-login agent
|
|
95
|
+
|
|
96
|
+
## Usage
|
|
97
|
+
|
|
98
|
+
### Menu bar app
|
|
99
|
+
```bash
|
|
100
|
+
trnscrb start
|
|
101
|
+
```
|
|
102
|
+
A mic icon appears in your menu bar with **Auto-transcribe** on by default — it will
|
|
103
|
+
automatically start and stop transcribing when it detects a meeting.
|
|
104
|
+
|
|
105
|
+
Or manually: click → **Start Transcribing** / **Stop Transcribing**.
|
|
106
|
+
|
|
107
|
+
### From Claude Desktop
|
|
108
|
+
Once the MCP server is configured (done by `trnscrb install`), Claude has access to:
|
|
109
|
+
|
|
110
|
+
| Tool | What it does |
|
|
111
|
+
|---|---|
|
|
112
|
+
| `start_recording` | Begin capturing audio |
|
|
113
|
+
| `stop_recording` | Stop, transcribe, save |
|
|
114
|
+
| `recording_status` | Check progress |
|
|
115
|
+
| `get_last_transcript` | Most recent transcript |
|
|
116
|
+
| `list_transcripts` | All saved meetings |
|
|
117
|
+
| `get_transcript` | Full text of one meeting |
|
|
118
|
+
| `get_calendar_context` | Current calendar event |
|
|
119
|
+
| `enrich_transcript` | Summary + action items via Claude API |
|
|
120
|
+
|
|
121
|
+
### CLI
|
|
122
|
+
```bash
|
|
123
|
+
trnscrb list # list all transcripts
|
|
124
|
+
trnscrb show <id> # print a transcript
|
|
125
|
+
trnscrb enrich <id> # run Claude LLM pass (needs ANTHROPIC_API_KEY)
|
|
126
|
+
trnscrb mic-status # live mic activity monitor (debug)
|
|
127
|
+
trnscrb devices # list audio input devices
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## System audio (BlackHole setup)
|
|
131
|
+
|
|
132
|
+
After installing BlackHole:
|
|
133
|
+
1. Open **Audio MIDI Setup** (Spotlight → "Audio MIDI Setup")
|
|
134
|
+
2. Click **+** → **Create Multi-Output Device**
|
|
135
|
+
3. Check both **BlackHole 2ch** and **MacBook Pro Speakers**
|
|
136
|
+
4. Go to **System Settings → Sound → Output** → select the Multi-Output Device
|
|
137
|
+
|
|
138
|
+
## Transcript format
|
|
139
|
+
|
|
140
|
+
```
|
|
141
|
+
Meeting: Weekly Standup
|
|
142
|
+
Date: 2024-01-15 10:00
|
|
143
|
+
Duration:23:14
|
|
144
|
+
|
|
145
|
+
============================================================
|
|
146
|
+
|
|
147
|
+
[SPEAKER_00]
|
|
148
|
+
00:12 Good morning everyone, let's get started.
|
|
149
|
+
|
|
150
|
+
[SPEAKER_01]
|
|
151
|
+
00:18 Morning! I finished the auth PR yesterday.
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
After running `trnscrb enrich <id>`, speaker labels are replaced with inferred names
|
|
155
|
+
and a summary + action items block is appended.
|
|
156
|
+
|
|
157
|
+
## Privacy
|
|
158
|
+
|
|
159
|
+
All audio processing happens on your device. No data leaves your machine except:
|
|
160
|
+
- If you run `enrich`, the transcript text is sent to Claude API (Anthropic)
|
|
161
|
+
- Calendar access uses AppleScript locally — no network calls
|
|
162
|
+
|
|
163
|
+
## License
|
|
164
|
+
|
|
165
|
+
MIT
|
trnscrb-0.1.0/README.md
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# trnscrb
|
|
2
|
+
|
|
3
|
+
Lightweight, fully offline meeting transcription for Claude Desktop.
|
|
4
|
+
A native macOS alternative to Granola — no cloud, no subscription.
|
|
5
|
+
|
|
6
|
+
## What it does
|
|
7
|
+
|
|
8
|
+
- Auto-detects meetings (Google Meet, Zoom, Slack Huddle, Teams, and more)
|
|
9
|
+
- Records your meeting audio (mic + system audio via BlackHole)
|
|
10
|
+
- Transcribes locally with Whisper (`small` model, Apple Silicon Metal)
|
|
11
|
+
- Identifies speakers with pyannote diarization
|
|
12
|
+
- Reads your calendar to auto-name meetings
|
|
13
|
+
- Saves every transcript as a plain `.txt` file in `~/meeting-notes/`
|
|
14
|
+
- Exposes everything to Claude Desktop via MCP so Claude can search, read, and enrich your notes
|
|
15
|
+
|
|
16
|
+
## Requirements
|
|
17
|
+
|
|
18
|
+
- macOS 13+
|
|
19
|
+
- Python 3.11+
|
|
20
|
+
- Apple Silicon recommended (M1/M2/M3) for fast local transcription
|
|
21
|
+
|
|
22
|
+
## Install
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
# One-liner bootstrap:
|
|
26
|
+
bash <(curl -fsSL https://raw.githubusercontent.com/ajayrmk/trnscrb/main/install.sh)
|
|
27
|
+
|
|
28
|
+
# Or if already cloned:
|
|
29
|
+
trnscrb install
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
The installer checks and optionally installs:
|
|
33
|
+
- BlackHole 2ch audio driver (via Homebrew)
|
|
34
|
+
- Python packages (faster-whisper, pyannote, rumps, sounddevice, mcp, …)
|
|
35
|
+
- HuggingFace token (for pyannote speaker diarization)
|
|
36
|
+
- Whisper `small` model (~500 MB, downloaded once)
|
|
37
|
+
- Claude Desktop MCP config entry
|
|
38
|
+
- Launch-at-login agent
|
|
39
|
+
|
|
40
|
+
## Usage
|
|
41
|
+
|
|
42
|
+
### Menu bar app
|
|
43
|
+
```bash
|
|
44
|
+
trnscrb start
|
|
45
|
+
```
|
|
46
|
+
A mic icon appears in your menu bar with **Auto-transcribe** on by default — it will
|
|
47
|
+
automatically start and stop transcribing when it detects a meeting.
|
|
48
|
+
|
|
49
|
+
Or manually: click → **Start Transcribing** / **Stop Transcribing**.
|
|
50
|
+
|
|
51
|
+
### From Claude Desktop
|
|
52
|
+
Once the MCP server is configured (done by `trnscrb install`), Claude has access to:
|
|
53
|
+
|
|
54
|
+
| Tool | What it does |
|
|
55
|
+
|---|---|
|
|
56
|
+
| `start_recording` | Begin capturing audio |
|
|
57
|
+
| `stop_recording` | Stop, transcribe, save |
|
|
58
|
+
| `recording_status` | Check progress |
|
|
59
|
+
| `get_last_transcript` | Most recent transcript |
|
|
60
|
+
| `list_transcripts` | All saved meetings |
|
|
61
|
+
| `get_transcript` | Full text of one meeting |
|
|
62
|
+
| `get_calendar_context` | Current calendar event |
|
|
63
|
+
| `enrich_transcript` | Summary + action items via Claude API |
|
|
64
|
+
|
|
65
|
+
### CLI
|
|
66
|
+
```bash
|
|
67
|
+
trnscrb list # list all transcripts
|
|
68
|
+
trnscrb show <id> # print a transcript
|
|
69
|
+
trnscrb enrich <id> # run Claude LLM pass (needs ANTHROPIC_API_KEY)
|
|
70
|
+
trnscrb mic-status # live mic activity monitor (debug)
|
|
71
|
+
trnscrb devices # list audio input devices
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## System audio (BlackHole setup)
|
|
75
|
+
|
|
76
|
+
After installing BlackHole:
|
|
77
|
+
1. Open **Audio MIDI Setup** (Spotlight → "Audio MIDI Setup")
|
|
78
|
+
2. Click **+** → **Create Multi-Output Device**
|
|
79
|
+
3. Check both **BlackHole 2ch** and **MacBook Pro Speakers**
|
|
80
|
+
4. Go to **System Settings → Sound → Output** → select the Multi-Output Device
|
|
81
|
+
|
|
82
|
+
## Transcript format
|
|
83
|
+
|
|
84
|
+
```
|
|
85
|
+
Meeting: Weekly Standup
|
|
86
|
+
Date: 2024-01-15 10:00
|
|
87
|
+
Duration:23:14
|
|
88
|
+
|
|
89
|
+
============================================================
|
|
90
|
+
|
|
91
|
+
[SPEAKER_00]
|
|
92
|
+
00:12 Good morning everyone, let's get started.
|
|
93
|
+
|
|
94
|
+
[SPEAKER_01]
|
|
95
|
+
00:18 Morning! I finished the auth PR yesterday.
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
After running `trnscrb enrich <id>`, speaker labels are replaced with inferred names
|
|
99
|
+
and a summary + action items block is appended.
|
|
100
|
+
|
|
101
|
+
## Privacy
|
|
102
|
+
|
|
103
|
+
All audio processing happens on your device. No data leaves your machine except:
|
|
104
|
+
- If you run `enrich`, the transcript text is sent to Claude API (Anthropic)
|
|
105
|
+
- Calendar access uses AppleScript locally — no network calls
|
|
106
|
+
|
|
107
|
+
## License
|
|
108
|
+
|
|
109
|
+
MIT
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "trnscrb"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Offline meeting transcription for macOS — auto-detects meetings, transcribes locally, saves to Claude Desktop via MCP"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = {file = "LICENSE"}
|
|
11
|
+
authors = [{name = "Ajay Ram", email = "ajayrmk@gmail.com"}]
|
|
12
|
+
requires-python = ">=3.11"
|
|
13
|
+
keywords = ["transcription", "meeting", "whisper", "macos", "mcp", "claude", "offline"]
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Development Status :: 4 - Beta",
|
|
16
|
+
"Environment :: MacOS X",
|
|
17
|
+
"Intended Audience :: End Users/Desktop",
|
|
18
|
+
"License :: OSI Approved :: MIT License",
|
|
19
|
+
"Operating System :: MacOS",
|
|
20
|
+
"Programming Language :: Python :: 3",
|
|
21
|
+
"Programming Language :: Python :: 3.11",
|
|
22
|
+
"Programming Language :: Python :: 3.12",
|
|
23
|
+
"Programming Language :: Python :: 3.13",
|
|
24
|
+
"Topic :: Multimedia :: Sound/Audio :: Speech",
|
|
25
|
+
"Topic :: Office/Business",
|
|
26
|
+
]
|
|
27
|
+
dependencies = [
|
|
28
|
+
"rumps>=0.4.0",
|
|
29
|
+
"sounddevice>=0.4.6",
|
|
30
|
+
"numpy>=1.24",
|
|
31
|
+
"faster-whisper>=1.0.0",
|
|
32
|
+
"pyannote.audio>=3.1",
|
|
33
|
+
"mcp>=1.0.0",
|
|
34
|
+
"click>=8.1",
|
|
35
|
+
"anthropic>=0.25",
|
|
36
|
+
"scipy>=1.11",
|
|
37
|
+
]
|
|
38
|
+
|
|
39
|
+
[project.urls]
|
|
40
|
+
Homepage = "https://github.com/ajayrmk/trnscrb"
|
|
41
|
+
Repository = "https://github.com/ajayrmk/trnscrb"
|
|
42
|
+
"Bug Tracker" = "https://github.com/ajayrmk/trnscrb/issues"
|
|
43
|
+
|
|
44
|
+
[project.scripts]
|
|
45
|
+
trnscrb = "trnscrb.cli:cli"
|
|
46
|
+
|
|
47
|
+
[tool.setuptools.packages.find]
|
|
48
|
+
where = ["."]
|
|
49
|
+
include = ["trnscrb*"]
|
|
50
|
+
|
|
51
|
+
[tool.setuptools.package-data]
|
|
52
|
+
trnscrb = ["py.typed"]
|
trnscrb-0.1.0/setup.cfg
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.1.0"
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"""macOS Calendar integration via AppleScript.
|
|
2
|
+
|
|
3
|
+
No extra dependencies — uses the osascript CLI that ships with macOS.
|
|
4
|
+
Returns the current or next upcoming meeting within a 30-minute window.
|
|
5
|
+
"""
|
|
6
|
+
import subprocess
|
|
7
|
+
from typing import Optional
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
_SCRIPT = """
|
|
11
|
+
tell application "Calendar"
|
|
12
|
+
set now to current date
|
|
13
|
+
set windowEnd to now + (30 * minutes)
|
|
14
|
+
set found to {}
|
|
15
|
+
repeat with cal in calendars
|
|
16
|
+
try
|
|
17
|
+
set evts to (events of cal whose start date >= (now - 5 * minutes) and start date <= windowEnd)
|
|
18
|
+
set found to found & evts
|
|
19
|
+
end try
|
|
20
|
+
end repeat
|
|
21
|
+
if (count of found) is 0 then return ""
|
|
22
|
+
set evt to item 1 of found
|
|
23
|
+
set evtTitle to summary of evt
|
|
24
|
+
set evtStart to start date of evt as string
|
|
25
|
+
set evtEnd to end date of evt as string
|
|
26
|
+
set attendeeList to ""
|
|
27
|
+
try
|
|
28
|
+
repeat with a in attendees of evt
|
|
29
|
+
set attendeeList to attendeeList & (name of a) & ","
|
|
30
|
+
end repeat
|
|
31
|
+
end try
|
|
32
|
+
return evtTitle & "||" & evtStart & "||" & evtEnd & "||" & attendeeList
|
|
33
|
+
end tell
|
|
34
|
+
"""
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
def get_current_or_upcoming_event() -> Optional[dict]:
|
|
38
|
+
"""Return the nearest calendar event, or None if none found / Calendar denied."""
|
|
39
|
+
try:
|
|
40
|
+
result = subprocess.run(
|
|
41
|
+
["osascript", "-e", _SCRIPT],
|
|
42
|
+
capture_output=True,
|
|
43
|
+
text=True,
|
|
44
|
+
timeout=10,
|
|
45
|
+
)
|
|
46
|
+
output = result.stdout.strip()
|
|
47
|
+
if not output or "||" not in output:
|
|
48
|
+
return None
|
|
49
|
+
|
|
50
|
+
parts = output.split("||")
|
|
51
|
+
attendees = [a for a in parts[3].split(",") if a] if len(parts) > 3 else []
|
|
52
|
+
return {
|
|
53
|
+
"title": parts[0],
|
|
54
|
+
"start": parts[1],
|
|
55
|
+
"end": parts[2] if len(parts) > 2 else "",
|
|
56
|
+
"attendees": attendees,
|
|
57
|
+
}
|
|
58
|
+
except Exception:
|
|
59
|
+
return None
|