Commit Graph
3 Commits
Author SHA1 Message Date
Claude 56287d7bf5 App Store 2.0 (Mac and iPhone): versions, review clean-up, three features in the sandbox
Versions: Mac App Store 2.0 (20), iPhone app and its extensions 2.0 (20).

Now in the App Store build too:
- Open terminal / ⌃⌥T: brings the session's terminal forward (NSWorkspace only;
  ⌃⌥T was listed but did nothing).
- Coucou in a corner of the screen: the Position picker and dropping Mochi near a corner.
- Dictation in the chat: on-device speech recognition, microphone entitlement and
  usage strings.

Fixes for the store build:
- Hooks installed by 1.1 are seen as outdated (version stored at install), so
  Settings offers "Update hooks"; the install alert shows the settings.json about
  to be written (CLAUDE.md).
- The Claude Code badge reads the install flag instead of the container's ~/.claude.
- Restart Coucou relaunches through Launch Services, no shell helper (2.4.5).
- Mochi feels your Mac no longer reads other apps' CPU use (sandbox violations).
- The Portfolio pill is GitHub-only, as intended when it was added.
- The shared recap image and the iPhone app no longer point at the GitHub build.
- Privacy manifests for the Mac App Store app and the iPhone app and extensions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LJm3SRL9k3gBPaVtfPhwcT
2026-10-31 04:32:36 +01:00
LouisandClaude Sonnet 4.6 3b21e599b8 Coucou in 10 languages (#268)
* 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>

* Weekly recap: local history store + Spotify Wrapped-style card + share image

Adds a full weekly recap feature to Coucou Mac:

- RecapStore: @MainActor singleton that persists session history to
  ~/Library/Application Support/NotchBuddy/recap.json. Records turns
  (pill, project, start/end, files ±, commands, questions) and
  permission decisions. 12-week retention. Always active, independent
  of iPhone sync.

- WeeklyRecapCardView: notch card (.recap IslandView) with time,
  sessions, files and commands stats + "Share image" / "OK" buttons.

- RecapShareImageView: 1080×1920 SwiftUI view rendered with
  ImageRenderer. Shows Coucou branding, primary time stat, secondary
  stats, and badges (top agent, top project, busiest day, longest
  session). RecapSharePanel opens an NSPanel with copy/save/share.

- IslandTypes: .recap case added, ViewLayout matches .finished.

- HookServer: RecapStore calls on UserPromptSubmit, PreToolUse,
  PostToolUse (after buildFileDiff), Stop, SessionEnd, and
  sendApprovalDecision.

- AppState: recapEnabled + recapHideProjects (UserDefaults-backed).

- SettingsView: "Weekly recap" GroupBox in General with enable toggle,
  privacy toggle and clear button.

- AppDelegate: "Weekly recap" menu item + Monday ≥ 8am trigger after
  the greeting (shows once per week if there is activity).

- scripts/test-weekly-recap.swift: fills recap.json with a fake week
  of activity for manual testing.

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>

* feat: weekly recap fixes — sessionId keying, interval merge, Monday triggers, share image

- RecapStore: key drafts by sessionId (not pillId) to handle concurrent sessions; merge
  overlapping intervals for accurate "time coding"; Calendar(.iso8601) for Mon–Sun weeks;
  corrupt-file rename on load; pruneStale() drops drafts open > 2 h; clearHistory() always
  active; recordQuestionAnswered keyed by sessionId
- HookServer: update all RecapStore call sites to pass sessionId; add stop() in StopFailure
  and Interrupt; post .checkMondayRecap on SessionStart + UserPromptSubmit
- IslandWindowController: declare .checkMondayRecap notification name
- AppDelegate: checkMondayRecap() now internal, uses .iso8601 calendar, guards against
  pendingApproval/pendingQuestion; add NSWorkspace didWake + .checkMondayRecap observers
- WeeklyRecapView: draw Mochi via BotEngine Canvas in share image; add +/− lines stat;
  update footer to "Coucou · github.com/Louis-CFM/coucou"
- SettingsView: remove hardcoded path, always enable "Clear history" button
- test-weekly-recap.swift: remove .iso8601 date encoding (matches RecapStore default)

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

* feat: Coucou in 10 languages

Add Localizable.xcstrings (Xcode 15 String Catalog) with ~90 strings
translated into en, zh-Hans, hi, es, ar, fr, bn, pt-BR, ru, id.

- frenchStep → localizedStep; all step labels use String(localized: "step.*")
- bashVerb returns use String(localized:)
- PrimaryButton/SecondaryButton/AgentWho use Text(LocalizedStringKey(title))
- SearchingView.label, IntegrationCardView.statusLabel, FinishedView fallback
  all use String(localized:) for proper runtime lookup
- sectionTitle computed var uses String(localized:)
- SettingsSidebarRow uses Text(LocalizedStringKey(title))
- Language GroupBox in Settings → General: System + 10 languages, applies via
  AppleLanguages UserDefaults, Restart Coucou button
- AppState.appLanguage property reads current AppleLanguages preference
- AppDelegate menu items use NSLocalizedString
- IslandWindowController: .environment(\.layoutDirection, .leftToRight) keeps
  notch window LTR even for Arabic
- README invites community translation PRs

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

* feat(i18n): localize all visible text — 10 languages, 240 keys

- Add Localizable.xcstrings with 240 keys across ar, bn, es, fr, hi, id, pt-BR, ru, zh-Hans
- Localize SettingsView (agents, chat, integrations, iPhone, active pills, all status messages, NSAlert)
- Localize WeeklyRecapView (notch card + 1080×1920 share image)
- Localize ClaudePlanCardView (title, gauge labels, countdown/subtitle strings)
- Localize ShortcutLogic (displayName + islandShortcuts descriptions)
- Localize ShortcutsSettingsView (GroupBox titles, reset button, conflict tags)
- Add verbatim PrimaryButton/SecondaryButton inits for dynamic content (AskUserQuestion options, filenames)
- Fix AppState.appLanguage to read from persistentDomain so System is default
- Fix broken sentence fragments (file.ready %@, mail.with %@) into single format keys
- Fix "Active pills" translations (tabs not medicine pills)
- Fix "Too many hits at once." (clicking Mochi, not HTTP requests)
- Restart via Process sleep+open+NSApp.terminate so HookServer port clears
- project.yml: knownRegions + CFBundleLocalizations (10 codes) in NotchBuddy + CoucouAppStore
- Both NotchBuddy and CoucouAppStore schemes build clean

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

* fix(i18n): add en source values to all 246 keys, fix format-specifier key names, restart logic

- Add "en" source value to all 228 previously missing keys (was showing raw key in English)
- Rename 5 format-specifier key names to match code usage:
  settings.slots-used → settings.slots-used %lld
  status.local.{no-models,connected,connected.plural,unreachable} + specifiers
- Add 7 new keys: file.ready %@, mail.with %@, Weekly recap, Keep a history…,
  Stored locally…, Hide project names…, Clear history (all 10 languages)
- Remove orphan key settings.startup
- Fix restart logic: wait for PID to exit, use open bundleURL.path (not open -b)
- Fix Claude is reading interpolation to use String(format:) with %@ key
- Add defaultValue to all step.* String(localized:) calls
- Patch pbxproj knownRegions with all 10 locales

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

* fix(i18n): add 29 more notch card and action button translations (10 languages)

Activity, AUTO, Clear, Close, Copy, Deployments, Diff too large, Draft, Emails,
Loading…, Main, No calls scheduled, No changes, Nothing here, Open, Open Codex/Cursor/Music/Settings/VS Code,
Overview, Payments, Recent, Refresh, Resend, Save…, Schedule, Share…, Ask a question about it.

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(recap): onChange reload, pruneStale 2h, Monday re-check, card lines/questions, test PNG

- WeeklyRecapCardView: recalculate summary on onChange(state.view → .recap)
- RecapStore.pruneStale: track lastEvent on each event; sessions with no
  events for 2h become completed turns instead of being dropped silently
- AppDelegate Monday recap: re-check pendingApproval/pendingQuestion inside
  the delayed block before expanding to .recap
- Notch card: show +lines/-lines and answered questions when non-zero
- test-weekly-recap.swift: generate PNG of the share card

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

* feat/languages: localize 180+ strings across 10 languages

- Add 293-key Localizable.xcstrings with translations for all 10 locales
  (ar, bn, es, fr, hi, id, pt-BR, ru, zh-Hans) and complete en source values
- Localize IslandViewContent, SettingsView: upload status, mail flow,
  chat placeholder, music player, GitHub sections, n8n detail, auto-close
- French tutoiement (ta réponse, appuie, Demande-moi…, Recherche)
  and Russian ты form throughout
- Plural catalog entry for "status.local.connected %lld" (one/other)
- Positional args %1$@ %2$@ in status.local.unreachable for reordering
- Fix restart to pass app path as $1 argument (no shell injection)
- Remove options.knownRegions from project.yml (ignored by xcodegen)

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>

* fix(recap): weekKey inside async block, persist() in pruneStale, Debug menu

- Record recapLastShownWeek inside asyncAfter after expand(to: .recap)
  so the week is only marked shown if the card actually appeared
- Extract persist() helper in RecapStore; pruneStale calls persist()
  directly (avoid save→pruneStale recursion)
- #if DEBUG menu item "Render recap image" using RecapShareImageView

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

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-10-06 19:52:56 +02:00
LouisandClaude Sonnet 4.6 9b144d55b5 Weekly recap (#264)
* Weekly recap: local history store + Spotify Wrapped-style card + share image

Adds a full weekly recap feature to Coucou Mac:

- RecapStore: @MainActor singleton that persists session history to
  ~/Library/Application Support/NotchBuddy/recap.json. Records turns
  (pill, project, start/end, files ±, commands, questions) and
  permission decisions. 12-week retention. Always active, independent
  of iPhone sync.

- WeeklyRecapCardView: notch card (.recap IslandView) with time,
  sessions, files and commands stats + "Share image" / "OK" buttons.

- RecapShareImageView: 1080×1920 SwiftUI view rendered with
  ImageRenderer. Shows Coucou branding, primary time stat, secondary
  stats, and badges (top agent, top project, busiest day, longest
  session). RecapSharePanel opens an NSPanel with copy/save/share.

- IslandTypes: .recap case added, ViewLayout matches .finished.

- HookServer: RecapStore calls on UserPromptSubmit, PreToolUse,
  PostToolUse (after buildFileDiff), Stop, SessionEnd, and
  sendApprovalDecision.

- AppState: recapEnabled + recapHideProjects (UserDefaults-backed).

- SettingsView: "Weekly recap" GroupBox in General with enable toggle,
  privacy toggle and clear button.

- AppDelegate: "Weekly recap" menu item + Monday ≥ 8am trigger after
  the greeting (shows once per week if there is activity).

- scripts/test-weekly-recap.swift: fills recap.json with a fake week
  of activity for manual testing.

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

* feat: weekly recap fixes — sessionId keying, interval merge, Monday triggers, share image

- RecapStore: key drafts by sessionId (not pillId) to handle concurrent sessions; merge
  overlapping intervals for accurate "time coding"; Calendar(.iso8601) for Mon–Sun weeks;
  corrupt-file rename on load; pruneStale() drops drafts open > 2 h; clearHistory() always
  active; recordQuestionAnswered keyed by sessionId
- HookServer: update all RecapStore call sites to pass sessionId; add stop() in StopFailure
  and Interrupt; post .checkMondayRecap on SessionStart + UserPromptSubmit
- IslandWindowController: declare .checkMondayRecap notification name
- AppDelegate: checkMondayRecap() now internal, uses .iso8601 calendar, guards against
  pendingApproval/pendingQuestion; add NSWorkspace didWake + .checkMondayRecap observers
- WeeklyRecapView: draw Mochi via BotEngine Canvas in share image; add +/− lines stat;
  update footer to "Coucou · github.com/Louis-CFM/coucou"
- SettingsView: remove hardcoded path, always enable "Clear history" button
- test-weekly-recap.swift: remove .iso8601 date encoding (matches RecapStore default)

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

* fix(recap): onChange reload, pruneStale 2h, Monday re-check, card lines/questions, test PNG

- WeeklyRecapCardView: recalculate summary on onChange(state.view → .recap)
- RecapStore.pruneStale: track lastEvent on each event; sessions with no
  events for 2h become completed turns instead of being dropped silently
- AppDelegate Monday recap: re-check pendingApproval/pendingQuestion inside
  the delayed block before expanding to .recap
- Notch card: show +lines/-lines and answered questions when non-zero
- test-weekly-recap.swift: generate PNG of the share card

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

* fix(recap): weekKey inside async block, persist() in pruneStale, Debug menu

- Record recapLastShownWeek inside asyncAfter after expand(to: .recap)
  so the week is only marked shown if the card actually appeared
- Extract persist() helper in RecapStore; pruneStale calls persist()
  directly (avoid save→pruneStale recursion)
- #if DEBUG menu item "Render recap image" using RecapShareImageView

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:57 +02:00