Commit Graph
14 Commits
Author SHA1 Message Date
Claude 5461634c49 Windows and Linux: approve Antigravity commands from the island
Port of the Mac's "Approve commands from the notch" (#934). Antigravity has
no permission request: it runs PreToolUse before its own permission check and
waits for the hook's decision. With Settings → Agents → Antigravity →
Approve commands from the notch (off by default, shown once the hooks are
installed), a run_command that none of Antigravity's command(...) rules
covers waits on the island's card: Allow prints {"decision":"allow"}, Deny
{"decision":"deny","reason":"Denied from Coucou"}, and Reply in terminal, no
click, a full card or Coucou closed print {"decision":"ask"}. Coucou never
allows a command without a click.

- agy_rules.rs: AgyPermissionRules.swift in Rust (CLI settings, global
  grants, the session's project or "outside of project"), with the Swift
  tests plus Windows folder URIs and paths.
- agy_approvals.rs: the gate (setting, run_command, hooks.json timeout >=
  120 s, rules verdict unknown, wait min(timeout - 10, 110) s) and the
  setting's commands, owned by Rust like the phone switches.
- Relay: Antigravity's PreToolUse is tagged coucou_kind agy_pre_tool and
  reads one line: "ask" at once, or "pending" then allow / deny / ask. 3 s
  for the first line, 115 s once pending. A command longer than what the
  relay forwards is flagged and gets no card.
- App (pipe.rs): the event goes to the island as usual, then the card as a
  PermissionRequest; "pending" once the island acks it.
- PreToolUse hook installed with a 120 s timeout; Settings shows the Mac's
  "install again" hint for hooks written with 10 s.
- Card: Deny, Allow and Reply in terminal for Antigravity only. Mac strings
  reused (all already in strings.json), no extra.json entries needed.
- CHANGELOG, windows/README.md, docs/AGENTS.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LJm3SRL9k3gBPaVtfPhwcT
2026-11-06 13:13:25 +01:00
Claude 9c15f1310e Merge remote-tracking branch 'pr/934' into release-0.6
# Conflicts:
#	.github/workflows/build.yml
#	CHANGELOG.md
#	NotchBuddy/Sources/App/HookServer.swift
#	NotchBuddy/Sources/App/IslandViewContent.swift
2026-11-06 12:40:50 +01:00
Brendon AngandClaude Opus 5.5 128efcb77f Mac: approve Antigravity commands from the notch
Antigravity has no permission-request event: it runs PreToolUse before its
own permission check and waits for the hook's decision. With the new
Settings → Antigravity → Approve commands from the notch (off by default),
a run_command that none of Antigravity's command(...) rules covers waits on
the approval card: Allow prints {"decision":"allow"}, Deny prints "deny",
and Reply in terminal, no click or Coucou closed print "ask" (Antigravity's
own prompt). Coucou never allows a command without a click.

- AgyPermissionRules reads Antigravity's allow and deny rules (CLI settings,
  shared global grants, the session's project), so commands they cover get
  no card. Tested by scripts/test-agy-permissions.sh, added to CI.
- Relay: Antigravity's PreToolUse asks Coucou and reads one line back:
  "ask" at once, or {"pending":true} then the decision. It waits 3 s for the
  first line and 115 s for the click. The shell wrapper answers "ask" when
  Python is missing.
- The PreToolUse hook is installed with a 120 s timeout. Settings asks to
  install again the hooks written with the old 10 s.
- Card: Deny, Allow and Reply in terminal for Antigravity; other agents'
  cards are unchanged.
- Strings in the 14 languages, CHANGELOG, AGENTS.md, SPEC.md, README.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 14:15:57 +08:00
NikitaBulichevandClaude Opus 5.5 65cad9d32b Docs: Coucou for agents on a remote machine
docs/REMOTE.md: the relay and hooks on the server, the ssh -R tunnel from
the Mac (remove the socket a dropped connection leaves behind, or set
StreamLocalBindUnlink), keeping it up with launchd, what to do while the
Mac sleeps (ClientAliveInterval, or a heartbeat the hooks check), and which
sessions show up by CLAUDE_CODE_ENTRYPOINT, with a wrapper to filter them.
Linked from the README and docs/AGENTS.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-22 08:00:21 +00:00
Claude 60697cbc27 Merge #191 (Claude Desktop pill) on top of the agents added since
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LJm3SRL9k3gBPaVtfPhwcT
2026-10-07 18:36:09 +02:00
LouisandClaude Sonnet 4.6 721d34f55f Prepare Coucou 0.2.1 (#292)
* Prepare Coucou 0.2.1 (#288: Hermes Agent)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* README date and AGENTS.md wording for 0.2.1

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LJm3SRL9k3gBPaVtfPhwcT

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-10-07 17:48:41 +02:00
LouisandClaude Sonnet 4.6 ec1a4f2693 More agents: Copilot CLI, Muse Code, OpenCode, Amp (#263)
* feat: add GitHub Copilot CLI, Muse Code, OpenCode, Amp agents (#262)

- agent_copilot: writes ~/.copilot/hooks/coucou.json with camelCase
  Claude Code events; fail-closed — relay outputs
  {"permissionDecision":"ask"} on timeout so Copilot re-prompts
  instead of denying
- agent_muse: merges into ~/.config/muse/settings.json like Gemini;
  relay normalises snake_case events (pre_tool_use → PreToolUse, etc.)
- agent_opencode: writes ~/.config/opencode/plugins/coucou.js (JS
  plugin, fire-and-forget, never blocks OpenCode)
- agent_amp: writes ~/.config/amp/plugins/coucou.ts (TS plugin,
  display only, never blocks Amp)
- PillCatalog: agent_copilot #818CF8, agent_muse #38BDF8,
  agent_opencode #4ADE80, agent_amp #F59E0B — all githubOnly
- SettingsView: installer GroupBox + trigger/confirm functions for all 4
- IslandViewContent: pill-tap → terminal, isConfigured, isHooks, hints
- Python relay (both GitHub and App Store builds): normalize_event adds
  Muse snake_case mappings; fire-and-forget outputs {} for muse like
  gemini/antigravity; Copilot PermissionRequest timeout → ask JSON
- docs/AGENTS.md: entries for all 4 new agents

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* feat/more-agents: fix Copilot, Muse, OpenCode and Amp end-to-end

Copilot CLI:
- Hook format: camelCase event keys, bash/timeoutSec, event name as
  positional arg, version:1 at root
- Uninstall deletes the file entirely instead of leaving {}
- copilotHooksInstalled() checks "bash" key
- processPermissionRequest shows real Allow/Deny card for copilot agent;
  relay outputs {"permissionDecision":"allow|deny"} directly

Muse Code:
- Hook format: PascalCase event keys (was snake_case)
- Add PermissionRequest hook (120 s)
- Add schema_version:1 when creating a new settings file
- processPermissionRequest shows real Allow/Deny card for muse agent;
  relay outputs {"permissionDecision":"allow|deny"} directly

OpenCode plugin:
- Rewritten to use CoucouPlugin = async (ctx) => ({ event: async }) API
- Maps OpenCode event types to canonical Coucou names in the plugin itself
- Error handlers on spawn and stdin

Amp plugin:
- Rewritten to use amp.on('event-name', handler) API
- tool.call handler returns { action: 'allow' } (required by Amp)
- Per-event handlers for SessionStart/UserPromptSubmit/PreToolUse/
  PostToolUse/Stop with correct session_id forwarding
- Error handlers on spawn and stdin

Python relays (both GitHub and App Store versions):
- normalize_event: add sessionStart, userPromptSubmitted, agentStop,
  notification, stop
- normalize_tool_fields: add toolName->tool_name, toolArgs->tool_input,
  workdir->cwd (Copilot CLI fields)
- PermissionRequest: copilot/muse output {"permissionDecision":"allow|deny"}
  instead of hookSpecificOutput; always → plain allow for copilot/muse
- Normal events: add copilot to agents that output {} on stdout
- Wrap main() in try/except at top level

Shell wrapper:
- Output {"permissionDecision":"ask"} when python3 unavailable and
  the call is copilot permissionRequest (fail-closed guarantee)

Plugin safety:
- removeOpenCodePlugin/removeAmpPlugin check "generated by Coucou"
  header before deleting
- previewOpenCodePlugin/previewAmpPlugin and their write counterparts
  now use SHA-256 fingerprint to detect file changes between preview
  and write

Docs: update AGENTS.md with correct event tables for all four agents

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(agents): normalize_event, OpenCode hooks, Amp try/finally, Copilot/Muse Always button

- normalize_event: add preToolUse→PreToolUse, postToolUse→PostToolUse,
  permissionRequest→PermissionRequest, sessionEnd→SessionEnd (both relays)
- Wrapper shell: copilot without permissionRequest now returns {} (not nothing)
- OpenCode plugin: filter unknown event types, read from event.properties,
  use e.tool as string directly
- Amp plugin: surround forward() with try/finally so tool.call always returns
  {action:'allow'}; use typeof e.tool === 'string' check
- Move isCopilotRequest/isMuseRequest inside #if !APPSTORE guard
- Add handledNote cases for agent_copilot and agent_muse
- Reduce relay wait to 110s for Copilot/Muse
- Update docs/SPEC.md and windows/README.md with new agents

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* fix(agents): OpenCode separate tool hooks, README agent table

- Remove tool.execute.before/after from EVENT_MAP; add as top-level
  plugin object properties with correct async signatures
- Root README: agent list + config table with Copilot CLI, Muse Code,
  OpenCode (Mac-only), Amp (Mac-only)
- windows/README: Mac-only plugin installer note with workaround path

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-10-06 19:46:54 +02:00
Samuel MartinezandClaude Opus 5.5 344dc12f55 Claude Desktop: a declarable agent pill for sessions from the Claude app
Claude Code sessions started from the Claude desktop app (Code tab) set
CLAUDE_CODE_ENTRYPOINT=claude-desktop and have no VS Code terminal, so
the island ignored them (#32). Both nb-hook relays (GitHub and App Store)
now tag those events with coucou_agent: claude-desktop when no --agent
was given, so they reach their own pill with nothing extra to install.

- PillCatalog: agent_claude-desktop under Agents (every build), so it can
  be declared in Settings and stays as idle after a session ends.
- The pill's jump button and the finished card's primary button open the
  Claude app ("Open Claude") instead of activating a terminal.
- Permission requests from these sessions still get "ask" like any other
  external agent, so Claude Desktop shows its own prompt.
- docs/AGENTS.md: one paragraph on the new pill.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 13:46:05 -06:00
Louis 8a5c26328b Docs: the Linux beta is out (#93) 2026-10-02 02:43:01 +02:00
Louis adfef6b8a2 Pill catalog, multi-provider chat and docs (#87)
* design: agent pills, Settings agents section, model picker mockups

Three additions to notch-buddy.html:
- Agent pills: Gemini CLI (#4285F4), Antigravity (#FF7043), Codex (#22C55E)
  with two togglable variants (A: tinted bg / B: colored top accent)
- Settings panel: Agents section with per-tool install/uninstall buttons,
  inline diff preview and result directly under each row
- Model picker: variant A (compact dropdowns) and variant B (provider chips)
  each with a provider-change animation (wink or surprised, togglable)

New sim buttons: "Agents mélangés" and "Fin d'une session Gemini".
All controls in a new "Nouveautés" panel at the bottom of the controls.

* feat: agent pills variant B, multi-provider model picker, provider animation

Pills: top gradient accent + tool color label (uppercased) replacing the
plain grey label; border at higher opacity; shadow on hover.

Model picker: provider chips (Anthropic / Google / OpenAI) + model list
popover accessible from a capsule button in the chat prompt view. Mochi
plays the "surprised" emote whenever the provider changes.

Multi-provider chat: ClaudeService routes to chatOpenAICompatible() for
Google and OpenAI (OpenAI-compatible endpoint); API keys stored in
Keychain (google-api-key, openai-api-key); per-provider model choice
persisted in UserDefaults.

Settings: new "Chat — autres fournisseurs" section with Google and
OpenAI API key fields.

Prototype: variant B locked as default in notch-buddy.html.

* Keep the shipped pill design and add the rule to CLAUDE.md

* Load chat models from each provider's API

* Keep hidden views from pushing the island header off screen

* Declare your tools in Settings with a pill catalog

* Update the docs for the pill catalog and the multi-provider chat

* Keep the design mockups out of the prototype
2026-10-02 00:53:02 +02:00
Louis Railleandcorefusiion f6f7c93cc4 docs: Gemini CLI and Antigravity support
Update README setup table, CHANGELOG, support FAQ (EN+FR) and
AGENTS.md with real-world examples and event tables for Gemini CLI
and Antigravity.

Co-authored-by: corefusiion <corefusiion@users.noreply.github.com>
2026-10-01 20:38:58 +02:00
Louis RailleandTudor Lacatus e007790436 Restore deleted comments in hooks.ts; remove n°20 references
hooks.ts: restore seven comments removed by the previous commit that
have nothing to do with coucou_agent:
- "Silence here used to cost Claude Code nearly two minutes…"
- "The field is `prompt`; reading `message` meant…"
- "One card, one request. A second one must never quietly replace the
  first — … Hand it straight back to the terminal."
- "The relay's short ack window closes in 800 ms…"
- "Another agent holds the view, so the card would yank it away…"
- "Coucou answers within 108 s or not at all…"

Replace every "with Codex (n°20)" / "with Codex support (n°20)" with
"with Codex support" in HookServer.swift, hooks.ts and docs/AGENTS.md.

Co-authored-by: Tudor Lacatus <lacatu5@users.noreply.github.com>
2026-10-01 17:52:20 +02:00
Louis RailleandTudor Lacatus 46dfa6715a Fix coucou_agent routing: id prefix, collisions, approvals, label
- ID prefix: external agent pills use "agent_<name>" (not
  "integration_<name>") so no collision with existing integration pills
  (stripe, github, n8n…) and their Stop/SessionEnd cannot remove them.
- "claude" reserved: validateAgent rejects it, event routes to the
  Claude Code pill unchanged (Mac + Windows).
- PermissionRequest for external agents: answered immediately with no
  decision on Mac (ask → relay silent → agent re-asks in terminal) and
  declined on Windows; no approval card shown (n°20 / Codex will add it).
- AgentSource.agent: new case in Swift enum and "agent" in the TypeScript
  type; IslandViewContent shows "Agent" for these pills (closure call
  instead of invalid switch-as-argument).
- Windows (state.ts): removeTask(), upsertExternalAgent(), sort fix so
  dynamic agent_ pills sort after integration_ pills, not before them.
- Windows (hooks.ts): full coucou_agent routing mirroring the Mac logic
  — validateAgent, agentColor (hash-stable fallback), ensurePill(),
  Stop/SessionEnd remove the dynamic pill.
- docs/AGENTS.md: note that PermissionRequest is not yet supported.
- CHANGELOG: example renamed my-agent.

Co-authored-by: Tudor Lacatus <lacatu5@users.noreply.github.com>
2026-10-01 17:52:20 +02:00
Louis Raille c586234f21 docs: coucou_agent field for third-party agents (#7, #9)
- CHANGELOG: entry for n°12
- docs/AGENTS.md: new file — JSON format, hook command examples,
  event table, quick test for third-party agent integration
- docs/INTEGRATIONS.md §1: mention --agent flag and coucou_agent field
- README: update Claude Code bullet to mention other agents
2026-10-01 17:52:20 +02:00