|
5 | 5 | <key>Label</key> |
6 | 6 | <string>com.michaelcmar.event-watch-opencode</string> |
7 | 7 |
|
8 | | - <!-- Runs `opencode run` with the auto flag against the /event-watch |
9 | | - command, from the repo directory. The auto flag auto-approves the |
10 | | - permission prompts (bash, edit, write) that opencode would otherwise |
11 | | - stop and ask about interactively — needed since nothing is watching |
12 | | - this when launchd fires it. It only changes prompts that would |
13 | | - otherwise ask; it does not override any explicit "deny" rule in |
14 | | - opencode.json (there are none here). |
| 8 | + <!-- Runs run-event-watch-opencode.sh, which itself calls opencode run |
| 9 | + with the model and prompt body pulled from the command file, |
| 10 | + plus the auto flag. It's a wrapper instead of a plain |
| 11 | + `opencode run` against the /event-watch command because opencode |
| 12 | + run does not resolve custom slash commands (open upstream bug) |
| 13 | + — see the comment at the top of that script for details. If that |
| 14 | + ever gets fixed upstream, this plist can point straight at |
| 15 | + opencode again. |
15 | 16 |
|
16 | | - Before enabling this job, run the same command by hand once from a |
17 | | - terminal (omit the auto flag, so you can watch it) to confirm: |
| 17 | + Before enabling this job, confirm: |
18 | 18 | - `opencode auth login` has been run once to connect the OpenRouter |
19 | 19 | provider (stores the API key in opencode's own credential store, |
20 | 20 | not in this repo, so it's never committed). |
21 | 21 | - The Gmail MCP server's one-time OAuth consent has been completed |
22 | | - (see README/chat notes for the exact command) so its refresh |
23 | | - token is cached under ~/.gmail-mcp/ and future runs need no |
24 | | - browser interaction. |
25 | | - Update the path below to match `which opencode` on your machine if |
26 | | - it's not at /usr/local/bin/opencode. --> |
| 22 | + so its refresh token is cached under ~/.gmail-mcp/ and future |
| 23 | + runs need no browser interaction. |
| 24 | + Update the paths below if this repo or the opencode binary ever move. --> |
27 | 25 | <key>ProgramArguments</key> |
28 | 26 | <array> |
29 | | - <string>/usr/local/bin/opencode</string> |
30 | | - <string>run</string> |
31 | | - <string>--auto</string> |
32 | | - <string>/event-watch</string> |
| 27 | + <string>/Users/michaelcmar/Projects/event-watch/launchd/run-event-watch-opencode.sh</string> |
33 | 28 | </array> |
34 | 29 |
|
35 | 30 | <key>WorkingDirectory</key> |
36 | | - <string>/Users/michaelcmar/Documents/Developer/event-watch</string> |
| 31 | + <string>/Users/michaelcmar/Projects/event-watch</string> |
37 | 32 |
|
38 | 33 | <!-- launchd does not source your shell profile, so PATH must be set explicitly. |
39 | | - Run `which node` and `which opencode` locally and add their directories |
40 | | - here if the job fails to find either. |
| 34 | + Run `which node` locally and add its directory here if the job fails to |
| 35 | + find it (opencode needs it to spawn the Gmail MCP server via npx). |
41 | 36 |
|
42 | 37 | OPENCODE_ENABLE_EXA turns on opencode's built-in websearch/webfetch |
43 | 38 | tools (Exa-hosted, no separate API key needed); they're off by |
|
56 | 51 | </dict> |
57 | 52 |
|
58 | 53 | <key>StandardOutPath</key> |
59 | | - <string>/Users/michaelcmar/Documents/Developer/event-watch/logs/event-watch-opencode.out.log</string> |
| 54 | + <string>/Users/michaelcmar/Projects/event-watch/logs/event-watch-opencode.out.log</string> |
60 | 55 |
|
61 | 56 | <key>StandardErrorPath</key> |
62 | | - <string>/Users/michaelcmar/Documents/Developer/event-watch/logs/event-watch-opencode.err.log</string> |
| 57 | + <string>/Users/michaelcmar/Projects/event-watch/logs/event-watch-opencode.err.log</string> |
63 | 58 |
|
64 | | - <!-- Every day at 9:00 AM local time (daily instead of weekly, since |
65 | | - OpenRouter billing has no weekly-quota reason to hold back). --> |
| 59 | + <!-- Every day at 6:00 AM local time. --> |
66 | 60 | <key>StartCalendarInterval</key> |
67 | 61 | <dict> |
68 | 62 | <key>Hour</key> |
69 | | - <integer>9</integer> |
| 63 | + <integer>6</integer> |
70 | 64 | <key>Minute</key> |
71 | 65 | <integer>0</integer> |
72 | 66 | </dict> |
|
0 commit comments