Commit Graph
39 Commits
Author SHA1 Message Date
Claude e1f7f1d71f Merge #971: Flow on your Claude plan: clean-up, prompt mode and translation through Claude Code (NikitaBulichev) 2026-11-06 12:44:00 +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
Claude 17c785830d Settings → Shortcuts: a Screenshots box for the two capture shortcuts
The whole screen (⌘⇧2) and a zone (⌘⇧S) together at the top, each with its
switch, its recorder and a line saying what it does; they leave the global
list below. Found by the settings search too. Strings in the 16 languages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LJm3SRL9k3gBPaVtfPhwcT
2026-11-05 00:56:49 +01:00
Claude 7578fa6e2b Mac: ⌘⇧2 takes the whole screen, copied, with a thumbnail to drag
The screen the pointer is on, in one press (screencapture -R, the Mac's shutter
sound). The picture goes on the clipboard, ready for ⌘V in a chat (⌃V in Claude
Code's terminal), and a thumbnail shows in the bottom right corner like macOS's
own: drag it out (file URL and PNG), click to open it in Preview, swipe right to
put it away. It leaves after 6 s, 3 s after the pointer leaves it. Its own
shortcut in Settings → Shortcuts (quickScreenshot, ⌘⇧2), GitHub build only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LJm3SRL9k3gBPaVtfPhwcT
2026-11-05 00:32:45 +01:00
NikitaBulichevandClaude Opus 5.5 e2426b5502 Merge main (0.5.8) into feat/flow-subscription
Both sides added test steps to build.yml: the subscription run tests here,
Mail triage and the settings search on main. All three are kept.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-31 10:05:54 +00:00
Claude cdc4b3d7d0 Release prep: Mac 0.5.7, Windows and Linux 0.5.7 (Mail, settings search, Coucou in a corner)
- Mac 0.5.7 (build 24): Mail in the notch (search, filters, reading, actions),
  automatic sorting in Coucou → Mail with rules, banned words, VIPs and Undo,
  mail plans from the chat, search in the settings, Coucou in a corner of the
  screen. GitHub build.
- Windows and Linux 0.5.7: Mail with classic Outlook (Windows), Outlook script
  hardening (#1004 by @Ohualtex), settings search (#1002 by @Ohualtex).
- CHANGELOG, README versions and features, Linux links, What's new (16 and 14
  languages), SPEC 12 bis and INTEGRATIONS brought up to date with what ships.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LJm3SRL9k3gBPaVtfPhwcT
2026-10-31 01:45:47 +01:00
Claude 53eb18de1c Coucou in a corner of the screen
Besides the notch, the island can live in one of the four corners of its
screen: just under the menu bar at the top, just above the Dock at the
bottom. It rests as a small floating bar with Mochi in sight and opens from
its corner with every view. Chosen in Settings → Display → Position, or by
dropping Mochi near a corner (back at the top centre for the notch).

IslandPlacement holds the geometry (tested); the panel, the hit tests,
Mochi's eyes, Mochi on the desktop and the voice captions follow it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LJm3SRL9k3gBPaVtfPhwcT
2026-10-30 23:56:32 +01:00
NikitaBulichevandClaude Opus 5.5 90e3435ed2 Flow on your Claude plan: clean-up, prompt mode and translation through Claude Code
With Claude's switch on in Settings → Chat → Your AI subscriptions and
Claude Code installed (FlowCleanup.tool), Flow's clean-up, prompt mode
and translation run `claude -p` like the chat, with no tools and no web
at all, Claude Haiku 4.5 and no thinking. Off, or not installed: the key
as before. Same switch as the chat, so nothing new to set: it is on by
default when no key is saved, and a key user who never touched it keeps
the API.

Claude Code gets 6 s more than the key to start: 10 s for a clean-up (as
on Windows and Linux), 14 s for a translation, 18 s in prompt mode. When
it fails early (signed out, no answer), the key stands in with what is
left of that time; with no key the words are pasted as heard, as on any
other problem.

Signed out, the pill says so with the command to sign in again and an
Open Terminal button (once per launch when the key stood in, since
nothing was lost). The Flow window's switches are enabled with either
Claude Code or a key, and its hints and privacy lines name both
(16 languages).

scripts/measure-flow-subscription.py times each installed subscription
tool with Flow's flags on the Mac, started when the key comes up and
started when it goes down.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-30 07:52:14 +00: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
Claude ed79201d35 Merge remote-tracking branch 'origin/main' into feat/notetaker-echo-speakers
# Conflicts:
#	NotchBuddy/Resources/Localizable.xcstrings
#	docs/SPEC.md
2026-10-16 12:46:49 +02:00
Claude c6276017a6 Notetaker: remove the echo by the sound, merge a voice cut in two, correct misheard words
- Both recordings share one clock: the Mac's sound starts with the silence it missed.
- Echo: the Mac's sound is the reference; a microphone word with no more energy than
  its echo is the others'. Plus a word-level check for runs of their words.
- A speaker heard only in short bits goes back to the closest real voice.
- Claude corrects the transcript before the summary (checked, raw kept) and names
  people when the call says who they are.
- Fix a line, reassign it or delete it; corrected words are learnt for the next calls.
- Renaming a speaker with another's name merges them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LJm3SRL9k3gBPaVtfPhwcT
2026-10-15 20:44:39 +02:00
Claude d57e4e9d73 Flow: prompt mode and translation into ~70 languages and regional variants
Two settings in Coucou → Flow → Settings. Prompt mode turns what you say into a
structured prompt for an agent (goal, context, steps, constraints, done when),
inventing nothing. Translate into: speak any language, paste in the chosen one —
US/UK/Australian/Canadian English, France/Québec/Swiss/Belgian French, Swiss and
Austrian German, Spain/Mexico/Argentina Spanish, Brazil/Portugal Portuguese,
Turkish, Italian and many more, each with what makes it different. One Claude call
with the user's key does the clean-up, the prompt and the translation; any problem
and the words are pasted as heard. Strings in ten languages.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LJm3SRL9k3gBPaVtfPhwcT
2026-10-15 19:36:08 +02:00
Claude b7e6c4b3aa Capture on ⌘⇧S, with a tick when the shortcut lands and each step in the log
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LJm3SRL9k3gBPaVtfPhwcT
2026-10-15 18:12:36 +02:00
Claude d59fb02ac5 Remove Focus (timer, headphones, project time); stressed Mochi a little calmer
Louis dropped Focus. Mochi under load now hops a little slower and less far, his eyes
dart a little less often, and the sweat comes in slightly slower bursts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LJm3SRL9k3gBPaVtfPhwcT
2026-10-15 17:54:13 +02:00
Claude 5ad0083ea9 Spec: Mochi and the Mac, Focus, screen capture
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LJm3SRL9k3gBPaVtfPhwcT
2026-10-15 16:17:03 +02:00
Jhoan GallegoandClaude Opus 5.5 7dcc5c52ca Merge Louis-CFM/coucou main (Windows and Linux 0.2.0) into the Spotify / Apple Music branch
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-08 01:11:46 +02:00
Claude 801bf5206b Merge #236 (README line updated on top of main's; project file left to XcodeGen)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LJm3SRL9k3gBPaVtfPhwcT
2026-10-07 18:35:40 +02:00
Jhoan GallegoandClaude Opus 5.5 61ac6e9a11 Merge Louis-CFM/coucou main (0.2.1, Hermes Agent) into the Spotify / Apple Music branch
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-07 17:52:03 +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
Jhoan GallegoandClaude Opus 5.5 84009687fe Merge Louis-CFM/coucou main (10 languages, more agents, weekly recap) into the Spotify / Apple Music branch
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 20:01:05 +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
Jhoan GallegoandClaude Opus 5.5 38f7d71ac7 Mac: Spotify pill and a richer Apple Music card
Spotify (GitHub build): a new integration_spotify pill. Its card shows the
album cover, title, artist and album, a progress bar you drag or click to
seek, play/pause, previous/next, shuffle, repeat and volume. State comes from
Spotify's com.spotify.client.PlaybackStateChanged notification and AppleScript;
nothing polls and Spotify is never launched by Coucou. The cover comes from
Spotify's `artwork url`, or from its public oEmbed before Automation is allowed.

Apple Music: the card gets the same layout, with the cover (from Music, or
Apple's public iTunes Search API when the track has none), seek, shuffle,
repeat all/one, volume and a favorite heart. The pill ID, the hover pill and
the Automation-denied card are unchanged.

The cover, bar, volume and buttons live in NowPlayingViews.swift and are shared
by both cards; each player keeps its own controller. Mochi dances for either.
Privacy page, README, SPEC, INTEGRATIONS and CHANGELOG updated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-05 16:40:25 +02:00
Steeven 4c4831d732 Choose which screen Mochi lives on
Settings → General → Display: the screen with the notch (default, unchanged
behaviour), the main screen with the menu bar, a specific screen by name, or
Follow the mouse.

- IslandDisplayChoice.swift (new): pure choice + resolver, tested by
  scripts/test-display-choice.sh. A chosen screen is stored by its display
  UUID and falls back to the notch screen while it is disconnected.
- IslandWindowController: relocate(to:) recomputes the resting geometry
  (notch or bar) and moves the panel. Follow the mouse runs in the existing
  60 Hz loop and only moves a hidden or compact island, never an open one.
  The island now follows screen changes (plug, unplug, lid, resolution).
- Settings window and desktop Mochi flights target the island's screen.
- BotCanvasView: eye tracking used the global midX of NSScreen.main against
  a screen-local mouse position, so Mochi looked off on an external screen.
- docs/SPEC.md, README.md, CONTRIBUTING.md updated.
2026-10-05 14:07:28 +02:00
LouisandClaude Sonnet 4.6 9fe8294ec7 Keyboard shortcuts (#205)
* Keyboard shortcuts

Carbon RegisterEventHotKey for 10 global shortcuts (no Accessibility
permission needed). Migrates the existing ⌘⇧N hotkey from NSEvent global
monitor. Adds Settings → Shortcuts section to configure and toggle each
shortcut, detect conflicts, and reset to defaults. Island-local shortcuts
(⌘→/←, ⌘1-9, ⌘↓/↑, ⌘O/E/↩/K/,/P) active when the island has focus.

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

* fix(shortcuts): Escape when the island is key, real jump to terminal, card selection, General hotkey re-register, fly home

- Escape in local monitor: sendAction("cancelOperation:") so .onExitCommand
  on focused views (diff, Other… question) fires first; collapse only if nothing
  else consumed it.
- ⌃⌥T: guard on focusTask (error + annoyed if none), then use the same
  terminalBundleIds logic as the card's Open Terminal button; launch Terminal.app
  if no terminal is running.
- Card navigation: navigateCard uses ShortcutLogic.navigate + cardItemCount
  (AppState); openCardSelection posts .islandActivateCardSelection; GitHubDetailView
  handles it and opens the selected PR/repo row. Rows show a white-12% rounded
  overlay when selected. cardItemCount set on appear/disappear.
- Settings → General: Toggle + ShortcutRecorderButton now call
  HotKeyCenter.shared.reregister(.toggleIsland) on change, so the hotkey
  updates without relaunching the app.
- ⌃⌥D when Mochi is on desktop: calls flyHome() (animated fly + "peek" sound)
  instead of uninstall().
- ShortcutLogic.navigate(selection:delta:itemCount:) pure function + 9 new
  testCardNavigation cases.

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

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-10-04 16:53:31 +02:00
LouisandClaude Sonnet 4.6 2b02b91565 Mochi on the desktop (#198)
* feat: Mochi on the desktop

Drag Mochi out of the notch and drop him anywhere on the screen — he
lives as a floating 120 pt companion until you double-click to fly him home.

- **DesktopMochi.swift** (new): `DesktopMochiController` manages the
  floating NSPanel (.floating level, canJoinAllSpaces/stationary/
  ignoresCycle/fullScreenAuxiliary), 60 Hz polling loop, click-through
  toggle, drag repositioning, double-click fly-home, right-click wardrobe,
  sleep detection (2 min idle + mouse > 150 pt → .sleeping state), screen
  sleep/wake pause, position persistence and launch-restore fly animation.
  `DesktopBotView` renders the full character at 30 fps with rigid-roll,
  outfit, dance and eye tracking from the panel's own screen position.
- **AppState**: `mochiOnDesktop` published flag; `BotPlacement` hides the
  notch bot while it is true (same pattern as `isDraggingBot`).
- **BotCanvasView**: `lookOriginOverride: CGPoint?` parameter lets the
  desktop view override the island-based eye tracking.
- **IslandWindowController.finishDrag**: drop outside notch zone and no
  window → promote ghost panel to desktop Mochi via
  `DesktopMochiController.install(ghostPanel:at:)`; drop in notch zone →
  return to notch; drop on window → attach context (unchanged).
- **AppDelegate**: observes `.greetComplete` → `launchFlyIfNeeded()` so
  Mochi flies from the notch to the saved position after launch greeting.
- **Alert cycle**: hookExpand → surprised emote → retract (panel flies home,
  notch Mochi reappears for the alert, UserDefaults flag stays true) →
  pendingApproval/pendingQuestion clears → fly back to saved position.
- **docs/SPEC.md**: new §13 "Mochi sur le bureau" (French, full spec).
- **README.md**: one-line feature entry.

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

* fix(desktop): alert detection, App Store build, drops from the desktop, clicks, monitor leak, tests

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

* fix(desktop): no second Mochi from the hidden notch bot, alerts during flights

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

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-10-04 04:22:39 +02:00
LouisandClaude Sonnet 4.6 b5d2242126 Mochi wardrobe: outfits, seasons and physics (#195)
* feat: Mochi wardrobe — right-click for outfits, auto seasonal dressing

Outfit model (MochiWardrobe.swift):
- 17 outfits with stable UserDefaults rawValues (mochiOutfit key)
- seasonal() with Meeus/Jones/Butcher Easter algorithm
- Windows: witch hat Oct1-Nov1, santa Dec1-26, party hat Dec31-Jan2,
  hearts Feb13-15, bunny ears Easter±2/+1, sunglasses Jun21-Aug31
- resolved() respects manual selection or falls back to seasonal

Drawing (MochiOutfitDrawing.swift):
- All accessories drawn in code: hats follow head yaw (sin/cos foreshortening),
  glasses at eye level, scarf on lower body, bunny ears behind body
- Fade during mailbox morph (>0.3), heavy roll, and R≤14 (compact)
- Pumpkin: orange body gradient overlay + ribs + stem/leaf
- isMini bots never wear outfits

Wardrobe view:
- Right-click bot head → expands to .wardrobe; right-click again closes
- 30pt pill grid with static Canvas accessory icons, scroll + bottom fade
- Hover previews outfit on live Mochi; click selects + saves + pop sound
- Escape or house tab closes; header shows current/seasonal selection

Tests: 52 cases (seasonal boundaries, Easter 2026/2027/2028, rawValue
stability, unknown UserDefaults value → .auto)

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

* redesign: complete wardrobe visual overhaul

Visual iteration loop via new render script (scripts/render-outfits.sh +
scripts/RenderOutfits.swift): produces /tmp/coucou-outfits.png showing
all outfits at 5 angles (yaw ±0.45, front, pitch −0.45, compact).

Catalog: remove topHat, cap, strawHat, heartsHeadband (4 outfits dropped,
13 remain). Feb 13–15 seasonal now returns .none.

MochiOutfitDrawing.swift — full rewrite:
- mochiEyePositions() shared helper: glasses anchored to exact eye positions
- Hat mount system: hatBrimY/hatXS/hatBrimW helpers + split-brim technique
  (back brim drawn behind body, front brim + crown drawn in front)
- Party hat: pink bezier cone, white dots, round pompom (not star)
- Beanie: blue gradient, ribbed cuff, white pompom springing with sy
- Crown: gold base band, 3 rounded arch points (taller ptH=R*0.56), 3 pearls
- Witch hat: purple droopy bezier cone, orange ribbon, gold buckle, wide brim
- Santa hat: red droopy cone, puffy white ellipse band, white pompom
- Sunglasses: 2.3× eye width dark lenses on actual eye positions, bridge
- Round glasses: brown #92400E circular frames on actual eye positions
- Scarf: thinner (ry*0.22), lower (ry*0.55), red + two white stripes + fringe
- Pumpkin: 4 soft ribs + curved green stem + leaf; guard changed to !isMini
- Bow: bezier wings with highlights

BotEngine.swift:
- Pumpkin guard: bodyColor == nil → !isMini (works with integration pills)
- lerp: private → internal (shared with MochiOutfitDrawing)
- triggerEmote(.proud): add squash() for pop effect on wardrobe tap

BotCanvasView.swift:
- Remove .onChange(of: resolvedOutfit) block (was firing on hover/scroll
  not just explicit clicks)

AppState.swift:
- resolvedOutfit: per-day seasonal cache avoids recomputing Easter math
  on every frame

IslandViewContent.swift:
- .none icon: horizontal dash → circle with diagonal slash (⊘)
- Remove drawTopHatIcon, drawCapIcon, drawHeartsHeadbandIcon, drawStrawHatIcon
- Remove their cases from drawOutfitIcon()
- Remove outfitIconHeart (only used by removed functions)

tests/MochiWardrobeTests.swift:
- Feb 13–15 seasonal: heartsHeadband → none
- Remove topHat/cap/heartsHeadband/strawHat rawValue tests
- Add: removed rawValues ("topHat", "cap", "heartsHeadband", "strawHat")
  stored in UserDefaults → .auto (backwards compat)
- 57/57 tests pass

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

* feat: port outfit drawing to 3D reference implementation

Replace the hand-crafted outfit drawers with a faithful Swift port of
design/outfits/mochi-outfits.js — a Canvas 2D reference that reproduces
the exact same body geometry as BotEngine (same R/rx/ry, superellipse,
drawEyes formula).

Key concepts ported from the JS:
- MochiH struct: head geometry + physDx/physDy spring offsets
- EyeFrame / mEyeFrames(): shared eye-position helper (replaces
  mochiEyePositions), used by both BotEngine.drawEyes and glasses drawers
- 3D projection: mRingR, mRot3, mProj, mSurf — accessories follow the
  head with VIEW_TILT = -0.30 and ACC_PITCH = 0.4 (hats don't flip over)
- Arc helpers: mFrontArc, mCapClip, mFrontRun — front-visible arcs of
  spherical rings for realistic 3D wrapping
- mInvert + FillStyle(eoFill:true) — even-odd clip for beanie cuff etc.
- drawPompom: 11 overlapping radial-gradient bumps
- drawFuzzyBand: layered stroke with bump highlights (santa trim)

Outfit improvements:
- Beanie: knit meridian ribs, folded cuff via invert clip, physDx pompom
- Santa hat: bezier bag shape, fuzzy trim arc, physDx/physDy tip spring
- Party hat: 3D ring base, apex with physDx lean, polka dots, gold rim
- Crown: back half behind body, front half with coloured gems + gold tips
- Witch hat: witchBrimPts wobble + droop, physDx/physDy bent cone tip
- Sunglasses: temples to head edge, body-clipped lenses, glare stroke
- Round glasses: curved bridge, per-eye foreshortening, inner arc shine
- Scarf: frontArc-wrapped band, meridional stripes, physDx hanging knot
- Pumpkin: bodyColors ['#FFA94D','#E8590C'] replace the body gradient
  (not an overlay), 5 meridional ribs following proj
- Bow: 3D anchor at surf(0.86, 0.55, 1.02), rotates + scales with yaw

BotEngine.swift:
- physDx/physDy/physVx/physVy: damped spring (stiffness 60, damp 9)
  driven by yaw velocity and oy velocity; updated each frame
- drawBody: pumpkinColors param replaces the orange overlay approach
- drawEyes: refactored to call mEyeFrames(), keeping roll in eyePitch
- drawOutfitBehind/Front: build MochiH with physDx/physDy, call new sigs

IslandViewContent.swift:
- Wardrobe pill icons: each outfit shows a tiny Mochi wearing it
  (yaw=0, pitch=0, same render pipeline as live app, R=W*0.62*0.3)
- .auto: sparkles, .none: circle-slash — unchanged
- All individual draw*Icon functions removed (~200 lines deleted)

scripts/RenderOutfits.swift:
- Columns match sheet.html exactly: L(-0.5), front, R(0.5), up(p0.4),
  down(p-0.5), tilt(y0.3/p-0.25/t0.12) + small pill preview
- Outfit order matches reference: none, beanie, santaHat, partyHat,
  crown, witchHat, sunglasses, roundGlasses, scarf, pumpkin, bow
- Scale 0.62, W=190 (same as sheet.html), small=64

design/outfits/:
- mochi-outfits.js: JS Canvas 2D reference implementation
- mochi-outfits-reference.png: target planche (7 columns × 11 outfits)
- sheet.html: page that generates the reference planche

Both schemes build clean. All 9 test scripts pass.

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

* fix: outfit integration bugs, physics spring, presence transitions, roll

§1a — pumpkin body color: skip integration pill bodyColor when pumpkinColors=true
§1b — remove R>14 size guards; add simplified mode (no ribs/dots/gems) for R<16
§1c — rewrite mFrontArc/mFrontRun: silhouette tangent split (min-x / max-x),
       pick the higher-z arc — eliminates left-edge jump on yaw
§1d — wardrobe pill icons: R=10, cy+0.62×R shift gives hat headroom
§2  — outfit only on main pill, compact/peek, or wardrobe view; hidden otherwise
§3  — physics impulses: slap (physVy−=1.2, dx±=0.7), squash (physVy+=0.6),
       greet (physVx+=0.2)
§4  — outfitPresence (0→1 Ease.back 350ms / 1→0 180ms) via BotEngine.setOutfit();
       outfit change: exit old then enter new; wardrobe preview: instant
§5  — add roll to MochiH; mProjRoll for roll-following accessories (scarf, glasses,
       bow, pumpkin); z-based rollFade replaces fixed threshold for those accessories;
       hats keep fixed 1.2rad threshold
§6  — auto pill icon: seasonal Mochi + AUTO badge (capsule, 60% black, 7pt semibold)
renderer: add roll planche (6 angles 0..5π/3) and transition planche (p=0..1)

Visually verified via rendered planches: outfits, roll, transition all look correct.
Both schemes build (NotchBuddy + CoucouAppStore). All tests pass (57/57).

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

* feat: outfit transitions with movement, hat fly-off, roll front/behind switching, wardrobe hover header

§1 Transitions — movement, not just opacity
- outfitPresence tween uses Ease.inOut; Ease.back applied to position offsets in drawing code
- Hats / crown / bunnyEars: enter from (1-posP)×0.6ry above with (1-posP)×0.3rad rotation
- Glasses: slide down (1-p)×0.15ry on entry/exit
- Scarf: slide down (1-p)×0.2ry
- Bow: scale by p; pumpkin opacity only (body color driven by drawBody)
- squash() fired in entry tween completion for landing bounce

§2 Hat fly-off during doRoll
- rollTurns stored in BotEngine; squash() called at roll end
- Progress = roll / (2π × rollTurns); hat rises 0.9ry × sin(progress×π), self-rotates by H.roll, drifts physDx×0.4rx × sin(progress×π)
- Removed abs(roll)>1.2 threshold; crown and witch hat back parts fly in sync

§3 Roll-following accessories switch front/behind (no z-fade)
- Front pass: roll-following outfits (sunglasses, roundGlasses, bow, scarf, pumpkin, bunnyEars) skip when mProjRoll(H,(0,0,1)).z < 0
- Behind pass: draws them when anchorZ < 0 using same drawing functions
- bunnyEars: now uses mProjRoll for ear positions (ear width foreshortened from projected spread); included in roll-following set

§5 Wardrobe hover header
- hoveredOutfit takes priority over selection in headerRight
- Auto hover → "Auto · follows the seasons (now: <name>)"
- Any outfit hover → outfit displayName

Transition planche (p=0,0.3,0.6,1): hats enter from above with overshoot
bounce; scarf slides up into position; bunnyEars rise in; all invisible at p=0.
Roll planche (6 angles): hats spin above head and land; glasses/bow/scarf/pumpkin/bunnyEars
follow roll and flip between front/behind at anchor-z zero-crossing, no fade artifacts.

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

* fix: hat roll is a flat 2D spin, bunnyEars flatten; drawLayer removes ghost overlap

Roll corrections:
- Hat fly-off (beanie, santaHat, partyHat, crown, witchHat): drawn with mProj at
  roll=0 (no 3D twist), then ctx-translated up (0.9ry × sin(πu)), rotated 2πu
  around the hat's own pivot (-1.4ry in body space), drifted physDx×0.3rx×sin(πu).
  Crown and witchHat back parts fly in sync with the same transform.
- bunnyEars: removed from roll-following set; always drawn behind body via
  drawBunnyEarsBack with mProj (not mProjRoll). During roll: height × (1 - 0.8×sin(πu)),
  outward tilt ±0.6×sin(πu) rad per ear; snap-back squash comes from doRoll completion.

Transition corrections:
- All accessories rendered inside ctx.drawLayer { } to prevent internal alpha
  bleed (overlapping shapes no longer show through each other or through the head).
- Opacity = min(1, p × 2.5): fully opaque by p = 0.4; movement carries the entry.
- Movement scaled up: hats/crown/ears → (1-posP)×1.0ry up + scale 0.85+0.15×posP;
  glasses → (1-p)×0.25ry down; scarf → (1-p)×0.3ry down.
- morphFade (mailbox morph) applied to layer so no ghost during that fade either.

Roll planche: hats above head, upright → spin flat → land; bunnyEars squash at roll=π.
Transition planche: no head visible through witchHat/santaHat at p=0.3; scarf slides up.

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

* fix: hat roll — gentle swing instead of full spin, reduced rise to 0.45ry

- Rise: sin(πu) × 0.45ry (was 0.9ry) — hat stays within the Mochi canvas bounds
- Rotation: sin(2πu) × 0.35 rad flat swing — hat never goes upside-down
- Drift: physDx × 0.2rx (was 0.3rx)
- Same values applied to crown and witchHat back parts in behind dispatcher

Roll planche: all hats visible and upright across all 6 angles.

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

* feat: rigid-plane roll for outfit-wearing Mochi

When resolvedOutfit != .none and outfitPresence > 0.05, the entire
character (hands, outfit-behind, body, eyes, outfit-front) is drawn
inside a context rotated by `roll` around the body centre. The body
genuinely turns in screen space rather than producing an eye illusion.

- BotCanvasView: branch on rigid vs illusion roll; badge+particles
  (drawHandsAndExtras) remain outside the rotated context.
- BotEngine.drawOutfitBehind/Front: pass roll=0 to MochiH and the
  static dispatchers when outfit is present, so accessories sit fixed
  on the head and co-rotate with the body transform. Hat fly-off and
  bunnyEar flatten code auto-disables (triggered by H.roll, now 0).
- BotEngine.drawEyes: suppress roll addition to eyePitch when outfit
  is shown (no roll-through illusion needed; body rotates for real).
- BotEngine.bodyCenter(size:): new helper exposing cx/cy to callers.
- BotEngine.update: centrifugal physDx impulse proportional to roll
  angular velocity when Mochi wears an outfit (coefficient 0.18).
- Outfit .none kept on illusion path exactly as before.
- Roll planche: added .none row to verify illusion unchanged.

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

* docs(SPEC): update wardrobe section and activity grid

Wardrobe:
- Add outfit visibility rule (only shown when focusId == mainPillId,
  island not expanded, or view == .wardrobe).
- Document transitions (presence, drawLayer, Ease.back, per-accessory
  offsets) and physics (physDx/physDy spring, squash impulse,
  centrifugal force during roll).
- Document rigid-roll mechanic (outfit present) vs illusion roll (none).
- Auto pill: badge "AUTO" + season name on hover.
- Stable IDs updated to current set; removed values migrate to auto.
- Remove Valentine's Day from season calendar.
- Add design/outfits/ and scripts/render-outfits.sh as visual reference.

Activity grid: correct cell size to 7 pt, spacing 1.5 pt, ~23 weeks
(calculated from available width).

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

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-10-04 00:25:43 +02:00
LouisandClaude Sonnet 4.6 86fbb79238 GitHub pill: contribution grid (#187)
* feat: GitHub contribution grid in the notch

Data layer:
- GitHubActivity.swift: ContributionDay (date, count, level 0–4, weekday),
  GitHubActivity (total, weeks, fetchedAt), parse(), lastWeeks(), lastDays().
- GithubPoller: separate activity chain (activityInFlight, nextActivity),
  fetchActivity() with same tokenGeneration guard as pulse, 30 min cadence
  starting 15 s after launch, refreshActivityIfStale(maxAge:300).
- AppState.githubActivity: cleared on integration disable and token change.

UI:
- GitHubPulseCardView header: "★ N.Nk" + 7-day mini-row (7pt squares,
  spacing 2pt) when activity loaded; tapping opens Activity detail.
  "· N repos" removed from header (shown in detail instead).
- GitHubDetailSection.activity + GitHubDetailView routes to
  GitHubActivityDetailContent.
- GitHubActivityDetailContent: ~20-week grid (8pt squares, spacing 2pt,
  Sun at top); hover/tap shows "Oct 3 · 12 contributions" in header;
  header right opens github.com/<login>; refreshActivityIfStale on appear.

Tests: 31 cases in tests/GitHubActivityTests.swift + test script added to
scripts/ and CI (build.yml). Docs: INTEGRATIONS.md, SPEC.md, privacy.html.

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

* fix: activity grid fit, mini-row without stats, token reload, past year label

- Contribution grid: squareSize 8→7pt, spacing 2→1.5pt, numWeeks computed
  from available width (~23) instead of hardcoded 20; header-to-grid gap 5pt
- GitHubPulseCardView header: show 7-square mini-row even when githubStats is
  nil but githubActivity is loaded ("Overview" only when both nil)
- SettingsView.saveIntegrations: also call refreshActivityIfStale() alongside
  triggerPulseNow() when a new GitHub token is saved
- Replace "this year" with "past year" in headerRight and SPEC.md

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

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-10-03 18:32:10 +02:00
LouisandClaude Sonnet 4.6 daa4bec4e2 GitHub pulse: open PRs, CI status and reviews in the notch (#181)
* feat: GitHub pulse — open PRs, CI status and review requests in the notch

Adds a live GitHub integration to the integration_github pill:
- One GraphQL query fetches open PRs (CI + review decision), PRs
  to review and default-branch CI for 10 recent repos
- Adaptive polling: 60 s when a PR/CI is pending, 300 s otherwise
- Alerts (badge + sound) on CI failure, new review request, CI pass;
  priority: failure > review > pass; first poll is always silent
- GitHubPulseCardView replaces the stats card when pulse data is available
- GitHubDetailView with tappable PR/repo rows opens the matching GitHub URL
- Settings help text for the token (scope requirements)
- 37 unit tests covering parse, events, CIState and edge cases
- CI step "GitHub pulse tests" added to build.yml
- Docs: INTEGRATIONS.md §1quater, SPEC.md card/detail sections,
  privacy.html section 4 (EN + FR), README integrations line

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

* fix(github-pulse): 6 correctifs avant merge

1. Partial GraphQL errors: parse data when "data" key is present even if
   "errors" exists; only keep old data when "data" is absent/null.
   Replace print() with appendAppLog("github.log", ...) via private nbLog.

2. Badge: skip badge (not sound) when integration_github is already in focus.

3. Stale data: clear githubPulse when integration_github is removed from
   activeIntegrations (AppState.didSet); clear githubPulse (+ githubStats
   if deleted) when token changes in saveIntegrations(), then trigger an
   immediate pulse poll on new token via GithubPoller.triggerPulseNow().

4. Duplicate IDs: parse() deduplicates myPRs and toReview by id (keeps
   first). events() uses Dictionary(_:uniquingKeysWith:) for both PR and
   repo maps. 5 new tests covering parse-time dedup and event dedup.

5. GitHubRepoCIRowView: CI dot + short name (10.5 pt #9398A1) + branch
   (11 pt #C5C8CD) + status word right (failing/running/passing, 10 pt
   in CI colour). Tap opens repo/actions URL filtered on host==github.com.

6. Height: .clipped() on GitHubPulseCardView and GitHubDetailView outer
   containers; ScrollView maxHeight reduced to 80 pt (4 × 20 pt rows
   exactly) so list never overflows the 160 pt overview card.

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

* fix: GitHub card header shows stats inline, list height 3 rows + bottom fade

- GitHubPulseCardView: replace "Overview" label with "★ N · N repos" (11pt
  #8E939C) when githubStats available; fall back to "Overview" otherwise.
  Remove right-aligned stats text and Spacer. Trailing padding 12 → 36 to
  avoid ↗ button overlap.
- GitHubDetailView: maxHeight 80 → 60 (3 rows × 20pt, no half-row cut).
  Add bottom fade mask (black → clear over last 20%) when item count > 3.

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

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-10-03 16:34:00 +02:00
LouisandClaude Sonnet 4.6 d5d0e49c07 fix: revert FinishedView overflow, first-paragraph toOneLine (#179)
FinishedView: restore exact pre-live-diff layout (AgentWho + one-line
summary text + Open terminal / OK buttons, paddings leading 116 /
trailing 16 / vertical 4). Removed the touched-files list, the
showingDiff overlay and the DiffCardView branch. Kept the
finalLine → last non-diff step → "Session finished" text source from
live-diff; added .lineLimit(1).truncationMode(.tail). Deleted
AppState.touchedFiles(for:) which is now unused.

DiffEngine.toOneLine: stop at the first paragraph separator (blank
line, 3+ repeated -/*/_ chars, or line starting with |) so that long
tool output doesn't bleed into the finished-session summary. Also
strips leading bullet markers (-, *, •, N.). Falls through to the next
paragraph if the first one is empty. Nine new test cases added.

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-10-03 15:55:19 +02:00
LouisandClaude Sonnet 4.6 054030636f Live diff: see file changes in the notch (#177)
* feat: live diff — see file changes in the notch as Claude edits

- DiffEngine.swift (Foundation-only): LCS-based line diff with 3-line context
  hunks, 200 KB / 4000-line size guards, CRLF normalization; handles Edit,
  MultiEdit and Write tool inputs. String.makeDiffStep/parseDiffStep encode
  diff step metadata in a private-use prefix so TickerRowView can detect them
- HookServer: PostToolUse for Edit/MultiEdit/Write builds and stores a FileDiff
  in AppState.sessionDiffs[pillId], then appends a diff step. SessionEnd clears
  the session; 1-hour inactivity timer auto-expires diffs
- TickerRowView: diff steps render filename + "+N" (green #22C55E) + "−M"
  (red #F4505E), small monospaced — all other steps unchanged
- TickerView: tap on a diff step fires onDiffTap callback with the step index
- OverviewView: diff overlay (DiffCardView) replaces the ticker in the left
  card when a diff step is tapped; Escape or ← dismisses it
- DiffCardView: scrollable monospaced diff lines (10.5 pt), ±12% background,
  header with filename + totals + ↗ (code -g path:line or NSWorkspace)
- FinishedView: lists up to 4 touched files with +/− totals below the buttons;
  tapping a file opens its DiffCardView
- Tests: 38 assertions across 11 groups; all 6 test scripts pass

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

* fix: diff tap on integration pills, static final line after Stop

Bug 1 — diff step taps now work on both the current and completed ticker
rows for all pills (including integration pills like integration_claude).
IntegrationCardView gains an onDiffTap callback wired from OverviewView;
TickerView passes per-row closures computed from the row text rather than
a single global tap; activeDiffStep renamed to activeDiffIdx and stores
the sessionDiffs index directly so it survives appendStep's 20-step cap.
Diff card also closes on view/mode change.

Bug 2 — after Stop the ticker shows the last assistant message as static
text (#C9CDD4, no shimmer, checkmark icon) until a new turn starts.
DiffEngine.toOneLine strips Markdown and collapses whitespace; Stop reads
last_assistant_message (fallback message), calls toOneLine, appendStep
and sets AgentTask.finalLine. finalLine is cleared on SessionStart,
UserPromptSubmit, PreToolUse and SessionEnd. TickerRowView gates shimmer
and chevron on isActive (thinking || working).

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

* fix: stable diff ids, memory cap, ticker polish, Write jump, CI step

1. Stable diff ids: FileDiff gains an `id` int assigned by AppState from a
   monotonically-increasing counter (nextDiffId) that is never reset across
   sessions. appendSessionDiff sets and returns this id; the step marker
   encodes diffId instead of a transient array index. Lookup is now
   first(where: { \$0.id == diffId }) — tapping a step whose diff was
   evicted is a no-op.

2. Memory cap: appendSessionDiff keeps at most 50 diffs per pill (oldest
   evicted first). DiffEngine.fromNew applies the same 200 KB / 4 000-line
   limit as fromEdit (tooLarge, no hunks, line count preserved).

3. Ticker non-active style: staticColor (#C9CDD4) only when !isActive &&
   phase < 0.5 (current row); the completed row above keeps #6B7079.

4. FinishedView main text: finalLine ?? last non-diff step ?? "Session
   finished". Never shows a \u{E001}-prefixed diff marker string.

5. DiffCardView ↗ button: /opt/homebrew/bin/code added first; Write opens
   `code -g file:1`, Edit/MultiEdit opens `code file`. firstChangedLine
   removed from FileDiff (no longer used).

6. fromEdit perf guard: m*n > 1_000_000 triggers countFallback (tooLarge).

7. CI: "Diff engine tests" step added to build.yml.

Tests: new cases for m*n blowup, fromNew tooLarge, diffId > 9 round-trip.
Docs: INTEGRATIONS.md corrected for Write semantics and 50-diff cap.

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

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-10-03 15:31:39 +02:00
LouisandClaude Sonnet 4.6 c767db9249 Answer Claude questions from the notch (#165)
* feat: answer AskUserQuestion from the notch (issue #94)

Parse AskUserQuestion PermissionRequests into a Foundation-only AskQuestion
model (1–4 questions, 2–4 options each, single- or multi-select). The question
card shows options as buttons (single-select: click = answer; multi-select:
toggles + Send), a free-text Other… field, a 1/N counter for multi-question
flows, and a "Reply in terminal" fallback. nb-hook.py emits allow +
updatedInput when decision is "answer". 21 parsing and answer-construction
tests, CI step added.

Idea from issue #94 by @Vega8991

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

* feat: answer AskUserQuestion via PreToolUse --ask hook (Claude Code 2.1.85+)

- nb-hook.py --ask mode: guards tool_name == AskUserQuestion, injects
  coucou_kind, holds socket 125 s; on answer emits PreToolUse hookSpecificOutput
  with updatedInput {questions, answers} so Claude Code receives the replies
- HookServer: dedicated AskUserQuestion PreToolUse hook entry (130 s timeout)
  added to both buildHooksData() variants; hooksNeedUpdate() returns true when
  that entry is absent; banner updated accordingly
- handleClient routes coucou_kind == ask_user_question to processQuestionRequest;
  PermissionRequest for AskUserQuestion replies ask immediately; PreToolUse
  general event skips state update for AskUserQuestion
- AskQuestion.buildAnswers now returns [String: Any]: single-select → String,
  multi-select → [String] array (Claude Code 2.1.136+)
- QuestionView: ChipFlowLayout for option chips (shared with ModelPickerView),
  header shows 1/N counter + Reply-in-terminal link, Send/Next only for
  multi-select (disabled until a choice is made), single-select auto-advances
- Tests, docs updated; both schemes build clean

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

* fix: question card never appeared — treat .question as alert in expandIfNeeded

Added .question to the isAlert set so it force-expands when the island is
collapsed/hidden, and made it an always-wins view (alongside .approval) so it
replaces whatever is showing when the island is already open.

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

* fix: question card UX — compact Other field, auto-release fd, header label

- Other… mode: field + Send capsule + ✕ now on one line (no extra row),
  field has rounded background (white 7%, r8), Send capsule dims when empty,
  Escape key resets to options, multi-select Send button hidden while Other
  field is open
- releaseQuestionFD(): sends "ask" immediately when QuestionView disappears
  without an explicit answer (collapse, view change, another alert taking over),
  does not touch state.view — called via QuestionView.onDisappear
- Header label: "Claude Code is asking" (static, not project-name-dependent)

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

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-10-03 04:11:40 +02:00
LouisandClaude Sonnet 4.6 ad44a2f550 Claude plan usage in the notch: 5-hour and weekly limits (#159)
* Add Claude plan gauge pill with statusline relay and settings UI

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

* Fix claude-plan-gauge review: safe preview, live pill color, githubOnly, validation

- Preview writes nothing; all file I/O deferred to confirm (fixes cancel-uninstall data loss)
- Reinstall preserves existing statusLine padding/refreshInterval (only command swapped)
- Pill label and color computed live from claudePlanUsage at render; removed tasks mutation in didSet
- integration_claude_plan is githubOnly: true (App Store has no installer)
- Install checks xcode-select -p and shows clear error if CLTools missing
- nb-hook.py: invalid stdin returns early in normal mode; --statusline continues regardless
- Validation: clamp pct 100-200 to 100 (not rejected); reject pct > 200; reject resets_at > 400 days
- Card: TimelineView every 30s; DateFormatter created once with en_US_POSIX locale
- Settings Plan usage: shows Installed/Not installed state and only the relevant button
- Diff shows only the statusLine key (before/after), not full settings.json
- settings.json written with .withoutEscapingSlashes
- 27/27 tests pass

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

* docs: mark Claude plan gauge as GitHub build only

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

* Redesign Claude plan gauge: header pill and Settings toggle, not a catalog pill

- Remove integration_claude_plan from PillCatalog; it was never shipped
- Add "Show in the notch" toggle in Settings → Agents → Plan usage; enabling
  it auto-triggers relay install if not yet installed; cancelling reverts toggle
- Small capsule pill in IslandHeader (home view, GitHub build): colored dot +
  "Claude 73%" label, active look while plan detail is open
- Tap pill: ClaudePlanCardView replaces left card; showingPlanDetail resets on
  focusId/view/mode change; big Mochi takes plan usage color while open
- Card tweaks: fixed 50pt bar, arrow.clockwise icon, compact reset labels
  ("in 1 h 20" / "Mon 9:00"), subtitle "just now / N min ago / N h ago",
  no truncation; TimelineView every 30s
- App Store build unaffected (all new UI is #if !APPSTORE)

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

* Polish plan gauge: reset label, label width, cached relay state

- Weekly reset label: "Mon 9:00" without "Resets" prefix (icon suffices)
- Label column widened to 40pt so "5 hours" never truncates
- Cache relay-installed state in AppState.planRelayInstalled; set at launch,
  refreshed on Settings open and after every Install/Uninstall confirm;
  IslandHeader reads state.planRelayInstalled instead of calling
  HookServer.statusLineInstalled() on each render
- Uninstall confirm sets showPlanInNotch = false

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

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-10-03 02:13:38 +02:00
LouisandClaude Sonnet 4.6 2566843091 Chat with local models through Ollama and LM Studio, and Markdown in answers (#156)
* feat: Ollama and LM Studio chat via OpenAI-compatible streaming API

- Add ollama/lmstudio cases to ChatProvider with isLocal, pillID, init?(pillID:)
- Add LocalChat helpers: normaliseURL, parseSSEDelta, filterThinkingBlocks
- Stream local responses token-by-token via URLSession.bytes
- Add ai_ollama (#FACC15) and ai_lmstudio (#A3E635) pills to PillCatalog
- Add server URL settings in Settings → Chat (Local models GroupBox)
- NSAllowsLocalNetworking in both Info.plist targets

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

* feat: Markdown rendering in chat assistant responses

- Add ChatMarkdown block parser (Foundation only) and ChatMarkdownView renderer
- ChatBubble uses ChatMarkdownView for assistant messages
- Update system prompt to allow markdown formatting
- Add ChatMarkdown/LocalChat test suite with compile-and-run script
- Add test-chat-parsing step to CI build workflow

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

* refactor: move local model networking into LocalChat, add fake server e2e tests

- Add LocalChatError typed enum (serverUnreachable, modelNotFound, serverError)
- Add LocalChat.fetchModels with embedding model filter (nomic-embed, bge, etc.)
- Add LocalChat.streamChat: full SSE streaming with typed error handling
- Add LocalChat.progressiveFilter for partial think-block suppression
- ClaudeService delegates local streaming entirely to LocalChat.streamChat
- Add tests/fake_local_llm.py: stdlib Python server with think blocks, null-content
  deltas, model filter, unknown model 404, and Markdown streaming
- ChatParsingTests: unit tests + 4 end-to-end tests against fake server
- test-chat-parsing.sh starts/stops fake server with port-file handoff

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

* Local model connect flow, Markdown improvements, and docs update

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

* Fix pill hints, local model error flow, streaming scroll, and docs polish

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

* Make the chat test server start reliably on CI

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

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-10-03 01:21:40 +02:00
Louis 91baba574a Apple Music in the notch: what's playing, play/pause and skip, and Mochi dances (#144) 2026-10-02 20:26:28 +02:00
LouisandTudor Lacatus 123e713f07 Codex: live sessions and approvals from the notch (#130)
Co-authored-by: Tudor Lacatus <lacatu5@users.noreply.github.com>
2026-10-02 16:41:59 +02:00
Louis 5332f9ee4d Choose your main coding tool, show Cursor sessions on the Cursor pill, and fix the permission card when the island is open (#120) 2026-10-02 15:19:29 +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
Jean-Pierre b11a90d0b7 Adapt resting island to displays without a notch 2026-10-01 08:36:32 +02:00
Louis Raille af080da806 Coucou — first public release 2026-09-27 23:54:00 +02:00