diff --git a/packages/notch-mod/.claude-plugin/plugin.json b/packages/notch-mod/.claude-plugin/plugin.json index aa0c228..8ef1df8 100644 --- a/packages/notch-mod/.claude-plugin/plugin.json +++ b/packages/notch-mod/.claude-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "switchboard-notch", - "version": "0.1.1", + "version": "0.1.2", "description": "Claude's questions drop from your Mac's notch as a native card. Pick with 1-4, type your own answer, or press esc to answer in Claude Code as usual.", "author": { "name": "sameeeeeeep", diff --git a/packages/notch-mod/README.md b/packages/notch-mod/README.md index e119d55..b092f8b 100644 --- a/packages/notch-mod/README.md +++ b/packages/notch-mod/README.md @@ -74,11 +74,28 @@ as usual. ## What it does on your machine -The mod's only action is to run `helper/sb-card`, a small native program that draws one card and -prints your answer. It needs no permissions, makes no network requests, and exits as soon as you -answer. The binary is signed with Developer ID (STAYOFT VENTURES PRIVATE LIMITED, 55354KFTHU) and -notarized by Apple. Its source is [`helper/sb-card.swift`](helper/sb-card.swift). Source of truth: [`packages/notch-mod`](https://github.com/sameeeeeeep/switchboard/tree/main/packages/notch-mod) in the switchboard repo. To see what the mod -hooks before you load it, run `claude plugin validate` on this directory. +Everything the mod does is in [`hooks/register.js`](hooks/register.js) (about 90 lines): + +- **Which tool it answers, and when.** It handles only Claude Code's `AskUserQuestion` tool, and + only single-choice questions. When you pick or type an answer in the card, the mod returns that + answer in place of Claude Code's own question dialog, in the same shape the dialog returns. If you + press esc, the card times out (9 minutes), the question is multi-select, text or number, or the + card can't start, it hands the question back to Claude Code's dialog unchanged. +- **The one program it starts, and why.** It runs `helper/sb-card` (in this plugin) to draw the card, + with one argument: a JSON object holding the question, its options, and where to show the card. + It starts nothing else and runs no shell. +- **What it reads, and where that goes.** It reads the question Claude is asking (part of your + conversation) and passes it to `helper/sb-card` as that argument. `helper/sb-card` prints your + answer and exits, and the mod gives the answer back to Claude. Nothing is sent anywhere else: the + mod makes no network requests, and neither does `helper/sb-card`. +- **What it stores.** Only your `/notch` setting (on or off, notch or cursor), in Claude Code's + local storage for this plugin. + +`helper/sb-card` is a small native macOS program built from +[`helper/sb-card.swift`](helper/sb-card.swift) (about 230 lines of AppKit and SwiftUI). It needs no +permissions and writes no files. It is signed with Developer ID (STAYOFT VENTURES PRIVATE LIMITED, +55354KFTHU) and notarized by Apple. To list the mod's hooks and calls yourself, run +`claude plugin validate` on this directory. ## Privacy @@ -95,9 +112,10 @@ For security issues, email [sameeeeeeep@gmail.com](mailto:sameeeeeeep@gmail.com) ## Develop +The source lives in [`packages/notch-mod`](https://github.com/sameeeeeeep/switchboard/tree/main/packages/notch-mod) +in the Switchboard repo, which also holds the build and release scripts; this repo is a mirror. + ```sh -claude --plugin-dir "$PWD" # load this checkout; edits hot-reload +claude --plugin-dir "$PWD" # load a checkout for one session; edits hot-reload claude plugin test # unit tests (no session needed) -./build.sh # rebuild, sign and notarize helper/sb-card -./publish.sh # mirror to sameeeeeeep/switchboard-notch and release ``` diff --git a/packages/notch-mod/publish.sh b/packages/notch-mod/publish.sh index 855976e..0bc1ac2 100755 --- a/packages/notch-mod/publish.sh +++ b/packages/notch-mod/publish.sh @@ -22,7 +22,8 @@ git rm -rq --ignore-unmatch . >/dev/null cd - >/dev/null # Plugin files, plus a marketplace file so the repo is its own marketplace. -cp -R .claude-plugin hooks helper tests assets README.md build.sh publish.sh .gitignore "$TMP/repo/" +# build.sh and publish.sh stay here: they use the maintainer's notary and GitHub credentials. +cp -R .claude-plugin hooks helper tests assets README.md .gitignore "$TMP/repo/" rm -rf "$TMP/repo/.claude-plugin/types" # The directory's validator blocks macOS/Windows system files anywhere in the plugin folder. find "$TMP/repo" \( -name .DS_Store -o -name Thumbs.db -o -name desktop.ini -o -name __MACOSX \) -prune -exec rm -rf {} +