mirror of
https://github.com/Louis-CFM/coucou.git
synced 2026-12-07 07:32:35 +09:00
* iPhone Team widget: four Mochi with names and states, tap to open - Each tile: Mochi in his state, the agent or service name, a dot for the state, an outline when he waits for you. - Free spots show a faded sleeping Mochi instead of an empty square. - Tapping a tile opens that session in the app (coucou://session/<id>). - Equally urgent sessions: where you code and agents before services. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016qkcwzfTWvbmbc2y9dur6p * Team widget: Mochi in their own colors, looking around each minute - Each Mochi is drawn in his pill's color, like the mini Mochi in the Mac's notch, on a dark tile. - Widgets can't animate, so the timeline gives each calm Mochi a new pose every minute for an hour (look left, right, up, blink, happy squint), different per Mochi. A Mochi who needs you keeps his state's face. - The name sits closer to Mochi. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016qkcwzfTWvbmbc2y9dur6p * Team widget: GitHub, Stripe and Vercel fill the free spots The four spots are always taken: the Mac's sessions first, then calm GitHub, Stripe, Vercel (and Codex) Mochi in their own colors, looking around like the others. Only live sessions open a session when tapped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016qkcwzfTWvbmbc2y9dur6p * iPhone: every service Mochi with what the Mac sees, and a configurable Team widget - Mac: ServicePublisher writes one encrypted Service record per service (GitHub, Stripe, Vercel, Resend, Cal.com, n8n, Notion) from the data the pollers already keep: state dot, why it has that color, latest items. No extra API call, no key leaves the Mac. n8n keeps its last 10 runs for it. - Services are no longer published as agent sessions. - iPhone: a Services list under the sessions (all seven, connected or not) and a detail screen per service: the reason for the dot, then pull requests, payments, deployments, emails, bookings, runs or pages, with links. - Team widget: pick the Mochi of each spot in the widget's settings (Automatic by default). Every tile opens its Mochi in the app. - Privacy policy: the service data that goes to iCloud. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016qkcwzfTWvbmbc2y9dur6p * GitHub: fetch pull requests and CI for the iPhone too The pulse and activity were only fetched while the GitHub pill was in the notch, so the iPhone got nothing when it wasn't. With the iPhone sync on, they are fetched as well; the badge and sound still only go to the pill in the notch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016qkcwzfTWvbmbc2y9dur6p * Widgets: Mochi stays visible on a tinted Home Screen In the tinted and clear Home Screen styles iOS keeps only each pixel's opacity, so Mochi and his tile became plain white blocks. There Mochi is drawn by brightness (eyes become holes) and tiles get a faint wash. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016qkcwzfTWvbmbc2y9dur6p * iPhone: the last turn of a session, with its diffs - Mac: TurnRecorder builds the last turn of each session from the hook events HookServer already gets: the prompt, every tool call (commands with what they printed, trimmed), every file change with its diff (DiffEngine), and the final answer. One encrypted Turn record per session, replaced each turn. Size-capped to stay well under CloudKit's record limit. - iPhone: the session screen shows the prompt, "What it did" (tap a command for its output), "Files changed" (tap for a line-by-line diff) and Claude's answer. An ended session keeps showing its last turn. - Privacy policy: the last turn goes to iCloud, encrypted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016qkcwzfTWvbmbc2y9dur6p * iPhone last turn: fold long prompts and answers Prompts fold to 6 lines and answers to 10, with Show more / Show less. A background task finishing (a <task-notification> prompt) shows as its summary, with the raw details behind Show details. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016qkcwzfTWvbmbc2y9dur6p * Step B: send an instruction to Claude Code from the iPhone - iPhone: on a VS Code or Cursor session, write or dictate an instruction (on-device speech recognition when available); Face ID sends it as an encrypted Instruction record. - Mac (GitHub build, new switch, off by default): InstructionRunner checks for instructions every 15 s while on, takes each once (deleted on read), drops ones older than 10 min, and continues the last Claude Code session it saw for that pill: claude -p <text> --resume <session id>, in the session's folder. Folder and session come from this Mac's hooks, never from the phone. One run per session at a time. Hooks keep the notch, the iPhone and the permission requests working during the run. - Sessions tell the iPhone whether this Mac takes instructions. - Privacy policy: instructions and dictation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016qkcwzfTWvbmbc2y9dur6p * InstructionRunner: enabledKey readable outside the main actor Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016qkcwzfTWvbmbc2y9dur6p * iPhone: fix the crash when tapping a notification The async UNUserNotificationCenterDelegate methods finished off the main thread, and SwiftUI's app delegate asserted. Use the completion-handler versions and always call the handler on the main thread. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016qkcwzfTWvbmbc2y9dur6p * iPhone dictation: pick the language A language button next to the mic (the iPhone's languages, plus French and English), remembered between uses. The recognizer used to follow the device language only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016qkcwzfTWvbmbc2y9dur6p --------- Co-authored-by: Claude <noreply@anthropic.com>
59 lines
1.8 KiB
Swift
59 lines
1.8 KiB
Swift
import SwiftUI
|
|
|
|
// How a service Mochi reads on the iPhone: its dot color, a short status, and
|
|
// what the widgets get.
|
|
|
|
extension ServiceTone {
|
|
var color: Color {
|
|
switch self {
|
|
case .ok: .green
|
|
case .warning: .orange
|
|
case .error: .red
|
|
case .info: Color(red: 0.4, green: 0.7, blue: 1)
|
|
case .idle: .secondary
|
|
}
|
|
}
|
|
|
|
var label: String {
|
|
switch self {
|
|
case .ok: "all good"
|
|
case .warning: "needs a look"
|
|
case .error: "something failed"
|
|
case .info: "news"
|
|
case .idle: "quiet"
|
|
}
|
|
}
|
|
|
|
/// The Mochi face for this tone.
|
|
var botState: BotState {
|
|
switch self {
|
|
case .ok: .finished
|
|
case .error: .error
|
|
case .warning: .question
|
|
case .info, .idle: .idle
|
|
}
|
|
}
|
|
}
|
|
|
|
extension ServiceSnapshot {
|
|
var name: String { PillCatalog.definition(for: pillId)?.name ?? pillId }
|
|
var color: String { PillCatalog.definition(for: pillId)?.color ?? "#C0C4CC" }
|
|
|
|
/// What the widgets get (SharedSessions).
|
|
var shared: SharedSession {
|
|
let tone: SharedSession.Tone
|
|
let urgency: Int
|
|
switch self.tone {
|
|
case .error: tone = .error; urgency = 2
|
|
case .warning: tone = .warning; urgency = 3
|
|
case .ok: tone = .done; urgency = 4
|
|
case .info: tone = .info; urgency = 4
|
|
case .idle: tone = .idle; urgency = 6
|
|
}
|
|
return SharedSession(id: pillId, title: name, agent: name, color: color,
|
|
state: (self.tone == .ok ? BotState.idle : self.tone.botState).rawValue,
|
|
statusText: self.tone.label, tone: tone, urgency: urgency,
|
|
stepIndex: 0, stepCount: 0, currentStep: headline, updatedAt: updatedAt)
|
|
}
|
|
}
|