Commit Graph

263 Commits

Author SHA1 Message Date
Tobin South
9d468adfb8 math-olympiad: housekeeping (#1172)
* math-olympiad: add LICENSE, marketplace entry, and prettier formatting

- Add Apache 2.0 LICENSE file
- Register plugin in marketplace.json
- Run prettier (prose-wrap=always, 80 cols) over all plugin markdown
- Simplify model tier naming in reference docs

🏠 Remote-Dev: homespace

* Update .claude-plugin/marketplace.json
2026-03-30 20:56:21 +01:00
Dickson Tsai
183a6ca35d Merge pull request #1115 from anthropics/dickson/bash-prefix-hooks
fix: invoke .sh hooks via bash prefix (fixes #993)
2026-03-28 22:21:14 -07:00
Dickson Tsai
986deab6a1 fix: invoke .sh hooks via bash prefix; add version for cache invalidation
Fixes #993 (Permission denied on hook scripts) without relying on
client-side +x preservation.

The hook executor spawns commands via /bin/sh -c, which requires +x
to execute a script directly. Prefixing with bash reads the script
as data — mode bits are irrelevant. This works on all Claude Code
versions, whereas the client-side chmod fix (claude-cli #24666) only
shipped in v2.1.86.

All 3 scripts declare #!/bin/bash and use bashisms ([[ ]], =~), so
bash (not sh) is the correct interpreter.

The version field forces a fresh cache path (1.0.0/ instead of
unknown/), ensuring the new hooks.json reaches users with stale
caches.
2026-03-28 08:40:34 -07:00
russell-coleman
548bfa8375 Merge pull request #1008 from anthropics/russell/imessage-conversational-format
feat(imessage): conversational format for chat_messages
2026-03-27 14:24:14 -07:00
Russell Coleman
a1ffbcc771 feat(imessage): add IMESSAGE_DB_PATH env var for testing
Mirrors the existing IMESSAGE_STATE_DIR override. Lets a mock sqlite
chat.db stand in for ~/Library/Messages/chat.db so chat_messages can be
tested without macOS + Full Disk Access + real iMessage history.
2026-03-27 13:45:56 -07:00
Noah Zweben
451c481b2b Update flint plugin sha to f3d56e3 (#1077)
Co-authored-by: Claude <noreply@anthropic.com>
2026-03-27 09:51:27 -07:00
Kenneth Lien
22bd61d01f imessage: bump to 0.1.0 2026-03-26 23:43:51 -07:00
Kenneth Lien
60c3fc36ed imessage: drop SMS/RCS by default, opt-in via IMESSAGE_ALLOW_SMS
SMS sender IDs are spoofable; iMessage is Apple-ID-authenticated and
end-to-end encrypted. The plugin previously treated both identically,
so a forged SMS from the owner's own number would match SELF, bypass
the access gate, and inherit owner-level trust — including permission
approval.

handleInbound now drops anything with service != 'iMessage' unless
IMESSAGE_ALLOW_SMS=true. Default is the safe path; users who want SMS
can opt in after reading the warning in README.
2026-03-26 23:41:39 -07:00
Kenneth Lien
c4274521de imessage: trim comment cruft 2026-03-26 23:16:27 -07:00
Kenneth Lien
8dfc279258 imessage: harden echo filter normalization
The self-chat echo filter matches outbound text against what chat.db
stores on round-trip. Three divergence sources caused false negatives
and duplicate bubbles:

- Signature suffix: "\nSent by Claude" is appended on send, but the
  \n may not round-trip identically through attributedBody
- Emoji variation selectors (U+FE00-FE0F) and ZWJ (U+200D): chat.db
  can add or drop these on emoji characters
- Smart quotes: macOS auto-substitutes straight quotes on the way in

Strip/normalize all three in echoKey() before the existing whitespace
collapse.

Fixes #1024
2026-03-26 23:12:19 -07:00
Kenneth Lien
c29338f276 imessage: drop whitespace-only messages from tapbacks/receipts
Tapback reactions and read receipts synced from linked devices arrive
as chat.db rows with whitespace-only text. The existing empty-check
used falsy comparison which doesn't catch ' ' or invisible chars,
causing unsolicited replies to reaction taps.

Fixes #1041
2026-03-26 23:11:49 -07:00
Kenneth Lien
03a685d5f6 imessage: restrict permission relay to self-chat only
Permission prompts were being broadcast to all allowlisted contacts plus
every DM resolvable from the SELF address set. Two compounding bugs:

1. SELF was polluted by chat.last_addressed_handle, which on machines
   with SMS history returns short codes, business handles, and other
   contacts' numbers — not just the owner's addresses. One reporter's
   query returned 50 addresses (2 actually theirs) resolving to 148 DM
   chats, all of which received permission prompts.

2. Even with a clean SELF, the handler sent to allowFrom + SELF, so
   every allowlisted contact received the prompt and could reply to
   approve tool execution on the owner's machine.

Fix:
- Build SELF from message.account WHERE is_from_me=1 only
- Send permission prompts to self-chat only, not allowFrom
- Accept permission replies from self-chat only

Fixes #1048
Fixes #1010
2026-03-26 23:11:29 -07:00
Dickson Tsai
72b9754680 Merge pull request #1031 from anthropics/dickson/add-terraform-plugin
Add terraform plugin files
2026-03-26 14:14:40 -07:00
Dickson Tsai
ba3a4e0702 Add terraform plugin files to match marketplace.json entry 2026-03-26 12:33:36 -07:00
Russell Coleman
28f7434384 feat(imessage): conversational format for chat_messages
Reformat chat_messages output from flat per-message lines to grouped
conversation threads. Each thread gets a header labelling it DM or Group
with its participant list, date-separator lines when the calendar day
rolls over, and [HH:MM] local-time stamps instead of full ISO.

chat_guid is now optional — omit to dump every allowlisted chat at once
for a quick multi-thread overview. Default limit raised 20→100 per chat,
capped at 500.

New queries: qChatParticipants (handle list per chat) and qChatInfo
(display_name + style to distinguish DM/group). renderMsg replaced by
conversationHeader + renderConversation.
2026-03-25 16:50:00 -07:00
Noah Zweben
b10b583de2 Add flint plugin to marketplace (#974) 2026-03-24 23:43:42 +00:00
Kenneth Lien
79caa0d824 Merge pull request #957 from anthropics/kenneth/fix-imessage-lockfile
Fix imessage startup: regenerate bun.lock without internal registry URLs
2026-03-23 23:53:32 -07:00
Kenneth Lien
12e9c01d5f Regenerate imessage bun.lock without artifactory URLs
The lockfile had 94 artifactory.infra.ant.dev URLs baked in from
generation behind a private registry. External users hit 401s on
'bun install' and the server never starts. Regenerated against
registry.npmjs.org to match the .npmrc.
2026-03-23 23:45:03 -07:00
Kenneth Lien
7074ac045b Merge pull request #737 from anthropics/add-imessage-channel
Add imessage channel plugin
2026-03-23 23:13:45 -07:00
Kenneth Lien
d49d339d1e Show input_preview only for Bash in permission prompts
Write/Edit previews are unbearably long over iMessage. Bash is the
dangerous one where seeing the command matters; everything else gets
tool_name + description only.
2026-03-23 23:05:00 -07:00
Noah Zweben
4b1e2a28ce feat(telegram,discord): compact permission messages with expandable details (#952)
* feat(telegram,discord): compact permission messages with expandable details

Replace verbose permission request messages with a compact format showing
only the tool name. Adds a "See more" button that expands inline to show
tool_name, description, and pretty-printed input_preview JSON. Yes/No
buttons replace Allow/Deny. Bump plugin versions to 0.0.4.

* revert: restore Allow/Deny button labels
2026-03-23 22:53:47 -07:00
Daisy S. Hollman
b3a0714d7f feat(telegram,discord): inline buttons for permission approval (#945)
Replace "Reply 'yes abcde' to allow" text instruction with native
inline buttons (Telegram InlineKeyboard, Discord ButtonBuilder).
One tap to approve/deny instead of typing a 5-char ID.

- Telegram: callback_query handler with allowFrom gate, edits message
  to show outcome and remove buttons after decision
- Discord: interactionCreate handler with allowFrom gate, updates
  interaction with outcome and clears components
- Text-reply path (PERMISSION_REPLY_RE) kept as fallback
- Bump both plugins to v0.0.3

🏠 Remote-Dev: homespace
2026-03-23 22:19:51 -07:00
Kenneth Lien
9693fd75c3 Document IMESSAGE_STATE_DIR in README 2026-03-23 20:12:20 -07:00
Kenneth Lien
bfed4635f5 feat(imessage): port permission-relay + lifecycle fixes from telegram
Brings the imessage channel to parity with recent telegram/discord
hardening:

- Permission-relay capability: declare claude/channel/permission,
  handle inbound permission_request notifications by fanning out to
  allowlisted DM chats + self-chat, intercept "yes/no <id>" replies
  after the gate check and emit structured permission events instead
  of relaying as chat. Groups excluded per single-user-mode policy.
- Global unhandledRejection/uncaughtException handlers so the server
  logs instead of dying silently.
- IMESSAGE_STATE_DIR env override for the state directory.
- .unref() on both setInterval timers so they don't block shutdown.
- stdin EOF / SIGTERM / SIGINT shutdown handler that closes chat.db
  and exits cleanly instead of leaving a zombie poll loop.

Adds zod as a direct dep (already transitively present via the MCP SDK)
for the notification handler schema.
2026-03-23 20:10:34 -07:00
Kenneth Lien
0f8c170fa7 Merge remote-tracking branch 'origin/main' into add-imessage-channel 2026-03-23 20:07:40 -07:00
Daisy S. Hollman
15268f03d2 Merge pull request #833 from anthropics/daisy/plugin-7/channel-permissions
feat(telegram,discord): permission-relay — approve Claude Code tool use from your phone
2026-03-23 13:15:41 -07:00
Daisy Hollman
daa84c99c8 feat(telegram,discord): permission-relay capability + bidirectional handlers
Complete the plugin side of anthropics/claude-cli-internal#23061 (permission
prompts over channels).

Capability: both servers now declare
  experimental["claude/channel/permission"]
which tells CC they can relay permission requests. This capability asserts the
server authenticates the replier — gate()/access.allowFrom filters
non-allowlisted senders before handleInbound runs.

Outbound (CC → user): setNotificationHandler for
  notifications/claude/channel/permission_request
formats the tool name, description, and input preview into a human-readable
message and sends it to every allowlisted DM. Groups are excluded — the
security thread resolution was "single-user mode for official plugins."

Inbound (user → CC): PERMISSION_REPLY_RE intercept in handleInbound catches
"yes xxxxx" / "no xxxxx" replies, emits the structured
  notifications/claude/channel/permission
event with {request_id, behavior}, reacts with checkmark/cross, and returns
without relaying the text to Claude as a chat message.

The regex is inlined from channelPermissions.ts (no cross-repo dep). IDs are
lowercased at the plugin boundary per the case-insensitive spec.

Version bumped 0.0.1 → 0.0.2 so the plugin reconciler picks up the change.

🏠 Remote-Dev: homespace
2026-03-23 08:59:02 +00:00
Sarah Deaton
92d061553f Drop tab-complete check, keep just /reload-plugins line 2026-03-21 20:18:35 -07:00
Sarah Deaton
b4f0bdd93a Restore /reload-plugins step in telegram/discord READMEs
Partially reverts #758. The reload step is not redundant: the configure
skill runs before the restart step, so it is not loaded yet when the user
types /telegram:configure. CLI prints 'Run /reload-plugins to activate.'
after install (pluginInstallationHelpers.ts:529). Mintlify reports
confirm users hit 'Unknown skill: discord:configure' at step 3.
2026-03-21 20:17:33 -07:00
Kenneth Lien
61c0597779 Merge pull request #825 from anthropics/kenneth/channels-rollup
Channels rollup: resilience + discord port + bucket-1 features
2026-03-20 17:40:59 -07:00
Tobin South
da61886c07 Merge pull request #823 from anthropics/claude/slack-add-claude-plugin-marketplace
fix(plugin): switch stripe plugin to git-subdir source and remove local copy
2026-03-20 23:02:17 +00:00
Kenneth Lien
6d0053f69e Add IMESSAGE_APPEND_SIGNATURE env var (default true) 2026-03-20 14:51:47 -07:00
Kenneth Lien
252577f8de Register imessage plugin in marketplace.json 2026-03-20 14:44:25 -07:00
Kenneth Lien
272de726d6 Merge branch 'main' into add-imessage-channel 2026-03-20 14:43:23 -07:00
Ralph Furman
d56d7b61f0 Merge pull request #755 from anthropics/ralph/add-math-olympiad
Add math-olympiad skill
2026-03-20 13:31:34 -07:00
Claude
802464cff3 Fix frontmatter validation to skip deleted files
The workflow was passing deleted files to the validation script, which
failed when trying to read them. Add --diff-filter=AMRC to only process
Added, Modified, Renamed, and Copied files.
2026-03-20 20:30:40 +00:00
Kenneth Lien
51bd7bd5f2 Merge remote-tracking branch 'origin/kenneth/telegram-all-file-types' into kenneth/channels-rollup 2026-03-20 13:13:58 -07:00
Kenneth Lien
71b102d75d Merge remote-tracking branch 'origin/kenneth/telegram-bot-commands-795' into kenneth/channels-rollup
# Conflicts:
#	external_plugins/telegram/server.ts
2026-03-20 13:13:58 -07:00
Kenneth Lien
556b21af96 Merge remote-tracking branch 'origin/kenneth/telegram-bot-commands' into kenneth/channels-rollup 2026-03-20 13:13:08 -07:00
Kenneth Lien
87e0f09336 Merge remote-tracking branch 'origin/kenneth/discord-resilience' into kenneth/channels-rollup 2026-03-20 13:13:08 -07:00
Kenneth Lien
aa4f7c4fb0 Merge remote-tracking branch 'origin/kenneth/discord-edit-notif-guidance' into kenneth/channels-rollup 2026-03-20 13:13:08 -07:00
Kenneth Lien
24a170a704 Merge remote-tracking branch 'origin/kenneth/channels-state-dir' into kenneth/channels-rollup 2026-03-20 13:13:07 -07:00
Kenneth Lien
f3fc62a8e7 Merge remote-tracking branch 'origin/kenneth/telegram-409' into kenneth/channels-rollup
# Conflicts:
#	external_plugins/telegram/server.ts
2026-03-20 13:13:07 -07:00
Kenneth Lien
757480dd76 Merge remote-tracking branch 'origin/kenneth/telegram-shutdown' into kenneth/channels-rollup 2026-03-20 13:12:58 -07:00
Claude
af6b2c490b Remove local stripe external plugin
Now that the stripe plugin sources from the stripe/ai git-subdir, the
locally vendored copy under external_plugins/stripe is no longer needed.
2026-03-20 20:09:40 +00:00
Claude
2bc9dfb449 Update stripe plugin to use git-subdir source
Change the stripe plugin source from local path (./external_plugins/stripe)
to git-subdir pointing to stripe/ai repo at providers/claude/plugin without
SHA pinning.
2026-03-20 19:59:36 +00:00
Kenneth Lien
1636fedbd4 Sanitize user-controlled filenames and download path components
- safeName() strips <>[]\r\n; from file_name/title before they hit the
  <channel> notification — delimiter chars would let an uploader break
  out of the tag or forge meta entries
- download_attachment strips ext/uniqueId to alphanumeric before join()
  — defense-in-depth against path traversal (file_unique_id is
  Telegram-controlled so this is belt-and-braces)
2026-03-20 11:56:57 -07:00
Kenneth Lien
ea382ec6a4 Tighten /start and /help copy
Less chatty, more precise. Explicitly mentions the /telegram:access
skill and the 6-char code format.
2026-03-20 11:55:56 -07:00
Kenneth Lien
9a101ba34c Restrict bot commands to DMs (security)
- /status in a group would leak the sender's pending pairing code to
  other group members, who could then pair as that user
- Commands in non-allowlisted groups confirm bot presence and enable spam
- /start now acknowledges dmPolicy === 'disabled' instead of lying
- setMyCommands scoped to private chats so the / menu only shows in DMs
2026-03-20 11:54:48 -07:00
Kenneth Lien
a9bc23da6f telegram: handle all inbound file types + download_attachment tool 2026-03-20 11:51:42 -07:00