Open source Grok Bot alternative, Bring your own agent and subscription: message Claude Code, Codex, Gemini CLI, Cursor, Copilot and 40+ AI agents as bots on your own computer, from iPhone, Mac, Windows, Linux or terminal. Agent-agnostic and free. Also a Muse and Dots alternative. Built in Rust.
Rust acpagent-client-protocolai-agentsai-assistantclaudeclaude-codecodexcoding-agentscursorgeminigemini-cligrok-bot-alternativeiosiphonelinuxmacosmcpopen-sourcerustself-hosted
feat(ios): animate the working bot in the dynamic island
leepokai315f05ebecc2
diff --git a/apps/Codync.xcodeproj/project.pbxproj b/apps/Codync.xcodeproj/project.pbxprojindex 2449fc8e..102f3a1b 100644--- a/apps/Codync.xcodeproj/project.pbxproj+++ b/apps/Codync.xcodeproj/project.pbxproj@@ -10,7 +10,10 @@00F78E3DAAF66E8E0933D091 /* ActivityGalleryView.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD3DE9A4EEB369C4F75C9448 /* ActivityGalleryView.swift */; };01A1F820EFEE49A8FCCFC3F3 /* BotListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0582B6169BFC36E4BCD51C0D /* BotListView.swift */; };0631979397E0D6822747E03A /* RootView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B6E13F8EA6C7B0DA4D899FEE /* RootView.swift */; };+ 0C920E4962F182ADF75670C5 /* CodyncBot-tablet-Ink.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 120FD9DBA315A6DD543463D8 /* CodyncBot-tablet-Ink.ttf */; };17DD96A91B1EC2AE699F4A2F /* ViewingBadge.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2C0E04490F5C56FD070539E6 /* ViewingBadge.swift */; };+ 1855DC364C2F8E5B62878BD8 /* CodyncBot-teardrop-Ink.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 203A43D8DF8D3832F95FA837 /* CodyncBot-teardrop-Ink.ttf */; };+ 198096547EAA6C5FBB68558F /* CodyncBot-hex-Ink.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 89A0D530BEF30AF36F9DBEA8 /* CodyncBot-hex-Ink.ttf */; };2002C16E427B4E4E7279E1C4 /* ComputerStatus.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6BC00039A6C2C0D3F39A5F67 /* ComputerStatus.swift */; };25667EBFCCC64B96FDCE95A9 /* CodyncKit in Frameworks */ = {isa = PBXBuildFile; productRef = 59F5D19A417A7A50596902FA /* CodyncKit */; };2CC074683AE086D6C77CC1E8 /* WidgetKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B274A0195CB3B2409EA4C194 /* WidgetKit.framework */; };@@ -18,10 +21,14 @@35CFB641A4F10C0EBD21CB14 /* LaunchSplash.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6FC76D28AB02DF1427D530ED /* LaunchSplash.swift */; };3BCC04815E5CA8953E0DDCAD /* WidgetPreviews.swift in Sources */ = {isa = PBXBuildFile; fileRef = 305DDCC18BB8AA6CD9D19CEF /* WidgetPreviews.swift */; };48DAAA1384E5B8D0BA27C895 /* SwiftUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1E47C60032C326157E0386B8 /* SwiftUI.framework */; };+ 4C9ADD8046382132129B1302 /* CodyncBot-squircle-Ink.ttf in Resources */ = {isa = PBXBuildFile; fileRef = CEF1A5792B9675FDA7E07740 /* CodyncBot-squircle-Ink.ttf */; };4DDC38E58D673047B332FDD5 /* AccessRequestView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B97102DEC6029268332DF901 /* AccessRequestView.swift */; };501377099B6CF42761B230CB /* WelcomeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D57A7C09154869DD84BACE19 /* WelcomeView.swift */; };52CF04B855C6AAEC47B75B8F /* CodyncKit in Frameworks */ = {isa = PBXBuildFile; productRef = 1285DDFA0390A76ECDAAD6C0 /* CodyncKit */; };54CEEA0734C2940E2D9FAC7D /* AXTree.swift in Sources */ = {isa = PBXBuildFile; fileRef = D4D13418ABB5FD7CFC087677 /* AXTree.swift */; };+ 5CF8180C760CFAE49CF4B8C6 /* CodyncBot-cloud-Tint.ttf in Resources */ = {isa = PBXBuildFile; fileRef = AAD970B8394F4EDFB85A8936 /* CodyncBot-cloud-Tint.ttf */; };+ 5FD48874687C2D18B31C7C01 /* CodyncBot-pebble-Tint.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 1FECC371F3CD98687C0B69FA /* CodyncBot-pebble-Tint.ttf */; };+ 646410F85B1110297E5F54B9 /* CodyncBot-squircle-Tint.ttf in Resources */ = {isa = PBXBuildFile; fileRef = D5F23C3F9FCE63B4AFB4771A /* CodyncBot-squircle-Tint.ttf */; };674BCFBAC7022359FB673FDB /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = AD18A04CD014230F1B7B0535 /* PrivacyInfo.xcprivacy */; };684F7F77EECBA0BD95BDD658 /* UsageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = CFEBE2E6A9D0AF0A0D89FFE7 /* UsageView.swift */; };719EABCBBAC0A973D729363A /* PairingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = ECD0B4EA4BBA2BB2826C4362 /* PairingView.swift */; };@@ -33,20 +40,29 @@8157F3E9CFB390CBCB1A9F9A /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 4815867922559696EDCA47FD /* Assets.xcassets */; };8517F8FC5AFAFF1527369829 /* NotificationService.swift in Sources */ = {isa = PBXBuildFile; fileRef = F6932F782C1B87C9608359A6 /* NotificationService.swift */; };89CA3972915769DBA315876F /* Push.swift in Sources */ = {isa = PBXBuildFile; fileRef = E3BF4D3B82FE8274F610C703 /* Push.swift */; };+ 8B5CCF45DEE9149BB11333C4 /* CodyncBot-pebble-Ink.ttf in Resources */ = {isa = PBXBuildFile; fileRef = F4375A206703EC65F0D15BD6 /* CodyncBot-pebble-Ink.ttf */; };+ 8B78A34695AD94109AE82C0F /* CodyncBot-blob-Tint.ttf in Resources */ = {isa = PBXBuildFile; fileRef = D0E552136D473567E0C25ED4 /* CodyncBot-blob-Tint.ttf */; };8BB3FC79EB798CE4347E6FD3 /* CodyncKit in Frameworks */ = {isa = PBXBuildFile; productRef = 50F314172CC2AD1C5CDC916A /* CodyncKit */; };921ED46A1643AB90BB3D4CF7 /* Session.swift in Sources */ = {isa = PBXBuildFile; fileRef = F99C11684BFBEB49006600A9 /* Session.swift */; };9638BAA981354C4CE72884A0 /* HostLink.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8CC3E47D480A5F15CA95C504 /* HostLink.swift */; };974A5D8D89758A61E7D8D1B6 /* Input.swift in Sources */ = {isa = PBXBuildFile; fileRef = 8BA06CEE98A7CDED62678522 /* Input.swift */; };+ 980C29719BDE2E874C9AD53A /* CodyncBot-wedge-Tint.ttf in Resources */ = {isa = PBXBuildFile; fileRef = C3BB9F034194450254CE14EC /* CodyncBot-wedge-Tint.ttf */; };9BBB2FAEDBD35A83EAB02981 /* AccountSwitcherView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4EB282B31FBC94EE70D07638 /* AccountSwitcherView.swift */; };AA601649E43A5AF73DCF5B5E /* WebRTC in Frameworks */ = {isa = PBXBuildFile; productRef = 2D9748E611692583AFC5A152 /* WebRTC */; };+ B09F6D6EDC6C6B0B9919D6BF /* CodyncBot-blob-Ink.ttf in Resources */ = {isa = PBXBuildFile; fileRef = C484135603CEF437C27BE67B /* CodyncBot-blob-Ink.ttf */; };+ B1815C13D0D78E99415C2DC2 /* CodyncBot-cloud-Ink.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 5A21538E748C62E82DF7B139 /* CodyncBot-cloud-Ink.ttf */; };+ B3450CFD87D4096B3BCA7885 /* CodyncBot-wedge-Ink.ttf in Resources */ = {isa = PBXBuildFile; fileRef = C6B96EE690FC5355C9E3D1B5 /* CodyncBot-wedge-Ink.ttf */; };B3554D38F39916698E961A37 /* WidgetGalleryView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B22589689593E0089118FDB /* WidgetGalleryView.swift */; };BA978F06CB1E58511FFB541B /* WidgetSetupDemo.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7D8961FADA8810B6CC479705 /* WidgetSetupDemo.swift */; };+ BCB60463C96AF5725EC4A2C7 /* CodyncBot-hex-Tint.ttf in Resources */ = {isa = PBXBuildFile; fileRef = D827E43025A592B41CB68EFD /* CodyncBot-hex-Tint.ttf */; };BF77DD7946621D8818EDAB9B /* SettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0A87B0091DAF0E4807D62017 /* SettingsView.swift */; };C7ED489193AC0934515D2E85 /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = D0DE72EEAEC947C1D3CA237F /* PrivacyInfo.xcprivacy */; };+ E78E3B5FAFEB79F31AAC104D /* CodyncBot-teardrop-Tint.ttf in Resources */ = {isa = PBXBuildFile; fileRef = C8F46BD8301E7E2C83C35111 /* CodyncBot-teardrop-Tint.ttf */; };EBB0417A5FB2CE6D514D21BE /* ClerkKit in Frameworks */ = {isa = PBXBuildFile; productRef = D9AB2F442A5F243653EAE936 /* ClerkKit */; };F171F16563D1FF6308697173 /* CodyncUI in Frameworks */ = {isa = PBXBuildFile; productRef = 06C9F37C6502131CAF0F145E /* CodyncUI */; };F842AE1C5ED96AF9A7F5D16C /* Widgets.appex in Embed Foundation Extensions */ = {isa = PBXBuildFile; fileRef = 6D734BEE7CD3F84677B0218B /* Widgets.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; };F97C489DDB806224CEFCEB57 /* ScreenHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 28B2CB561A43ED9F2F1A4391 /* ScreenHelper.swift */; };+ FCE6E509AEFC88C3D05D8E3D /* CodyncBot-tablet-Tint.ttf in Resources */ = {isa = PBXBuildFile; fileRef = F7CAD5C4F330637102B40288 /* CodyncBot-tablet-Tint.ttf */; };/* End PBXBuildFile section *//* Begin PBXContainerItemProxy section */@@ -85,8 +101,11 @@0582B6169BFC36E4BCD51C0D /* BotListView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BotListView.swift; sourceTree = "<group>"; };0829A4FCADAC108E8C2DB2F1 /* Widgets.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Widgets.entitlements; sourceTree = "<group>"; };0A87B0091DAF0E4807D62017 /* SettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsView.swift; sourceTree = "<group>"; };+ 120FD9DBA315A6DD543463D8 /* CodyncBot-tablet-Ink.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "CodyncBot-tablet-Ink.ttf"; sourceTree = "<group>"; };1318104275E5BEC47B7088AD /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };1E47C60032C326157E0386B8 /* SwiftUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SwiftUI.framework; path = System/Library/Frameworks/SwiftUI.framework; sourceTree = SDKROOT; };+ 1FECC371F3CD98687C0B69FA /* CodyncBot-pebble-Tint.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "CodyncBot-pebble-Tint.ttf"; sourceTree = "<group>"; };+ 203A43D8DF8D3832F95FA837 /* CodyncBot-teardrop-Ink.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "CodyncBot-teardrop-Ink.ttf"; sourceTree = "<group>"; };28B2CB561A43ED9F2F1A4391 /* ScreenHelper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ScreenHelper.swift; sourceTree = "<group>"; };2C0E04490F5C56FD070539E6 /* ViewingBadge.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewingBadge.swift; sourceTree = "<group>"; };305DDCC18BB8AA6CD9D19CEF /* WidgetPreviews.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WidgetPreviews.swift; sourceTree = "<group>"; };@@ -95,6 +114,7 @@4815867922559696EDCA47FD /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };4EB282B31FBC94EE70D07638 /* AccountSwitcherView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccountSwitcherView.swift; sourceTree = "<group>"; };52A96030D47F1B9678095909 /* iOS.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = iOS.entitlements; sourceTree = "<group>"; };+ 5A21538E748C62E82DF7B139 /* CodyncBot-cloud-Ink.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "CodyncBot-cloud-Ink.ttf"; sourceTree = "<group>"; };5B22589689593E0089118FDB /* WidgetGalleryView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WidgetGalleryView.swift; sourceTree = "<group>"; };60422D3CA8FEBCDC5AC465E0 /* iOS.app */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = wrapper.application; path = iOS.app; sourceTree = BUILT_PRODUCTS_DIR; };64888B10E98F19723500FBCA /* NotificationService.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = NotificationService.entitlements; sourceTree = "<group>"; };@@ -104,25 +124,37 @@741B706007BA1B91CB853699 /* Screen.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Screen.app; sourceTree = BUILT_PRODUCTS_DIR; };7B7E845BA1B8696B266CF578 /* NotificationService.appex */ = {isa = PBXFileReference; includeInIndex = 0; lastKnownFileType = "wrapper.app-extension"; path = NotificationService.appex; sourceTree = BUILT_PRODUCTS_DIR; };7D8961FADA8810B6CC479705 /* WidgetSetupDemo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WidgetSetupDemo.swift; sourceTree = "<group>"; };+ 89A0D530BEF30AF36F9DBEA8 /* CodyncBot-hex-Ink.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "CodyncBot-hex-Ink.ttf"; sourceTree = "<group>"; };8BA06CEE98A7CDED62678522 /* Input.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Input.swift; sourceTree = "<group>"; };8CC3E47D480A5F15CA95C504 /* HostLink.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HostLink.swift; sourceTree = "<group>"; };9AD0BD16672E128A4F26272B /* SignInButtons.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SignInButtons.swift; sourceTree = "<group>"; };A65FE0504B741D0B44DB2516 /* CodyncApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CodyncApp.swift; sourceTree = "<group>"; };+ AAD970B8394F4EDFB85A8936 /* CodyncBot-cloud-Tint.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "CodyncBot-cloud-Tint.ttf"; sourceTree = "<group>"; };AD18A04CD014230F1B7B0535 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; path = PrivacyInfo.xcprivacy; sourceTree = "<group>"; };B274A0195CB3B2409EA4C194 /* WidgetKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = WidgetKit.framework; path = System/Library/Frameworks/WidgetKit.framework; sourceTree = SDKROOT; };B6E13F8EA6C7B0DA4D899FEE /* RootView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RootView.swift; sourceTree = "<group>"; };B97102DEC6029268332DF901 /* AccessRequestView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AccessRequestView.swift; sourceTree = "<group>"; };+ C3BB9F034194450254CE14EC /* CodyncBot-wedge-Tint.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "CodyncBot-wedge-Tint.ttf"; sourceTree = "<group>"; };+ C484135603CEF437C27BE67B /* CodyncBot-blob-Ink.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "CodyncBot-blob-Ink.ttf"; sourceTree = "<group>"; };+ C6B96EE690FC5355C9E3D1B5 /* CodyncBot-wedge-Ink.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "CodyncBot-wedge-Ink.ttf"; sourceTree = "<group>"; };+ C8F46BD8301E7E2C83C35111 /* CodyncBot-teardrop-Tint.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "CodyncBot-teardrop-Tint.ttf"; sourceTree = "<group>"; };CE63C84233B14A2D63640EAA /* Capture.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Capture.swift; sourceTree = "<group>"; };+ CEF1A5792B9675FDA7E07740 /* CodyncBot-squircle-Ink.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "CodyncBot-squircle-Ink.ttf"; sourceTree = "<group>"; };CFEBE2E6A9D0AF0A0D89FFE7 /* UsageView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UsageView.swift; sourceTree = "<group>"; };D0DE72EEAEC947C1D3CA237F /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; path = PrivacyInfo.xcprivacy; sourceTree = "<group>"; };+ D0E552136D473567E0C25ED4 /* CodyncBot-blob-Tint.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "CodyncBot-blob-Tint.ttf"; sourceTree = "<group>"; };D4D13418ABB5FD7CFC087677 /* AXTree.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AXTree.swift; sourceTree = "<group>"; };D57A7C09154869DD84BACE19 /* WelcomeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WelcomeView.swift; sourceTree = "<group>"; };+ D5F23C3F9FCE63B4AFB4771A /* CodyncBot-squircle-Tint.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "CodyncBot-squircle-Tint.ttf"; sourceTree = "<group>"; };+ D827E43025A592B41CB68EFD /* CodyncBot-hex-Tint.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "CodyncBot-hex-Tint.ttf"; sourceTree = "<group>"; };DC3927FC6343A00B3970BC08 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };DD3DE9A4EEB369C4F75C9448 /* ActivityGalleryView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ActivityGalleryView.swift; sourceTree = "<group>"; };E3BF4D3B82FE8274F610C703 /* Push.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Push.swift; sourceTree = "<group>"; };ECD0B4EA4BBA2BB2826C4362 /* PairingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PairingView.swift; sourceTree = "<group>"; };F21AEC12DC761C28A997BEF3 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };+ F4375A206703EC65F0D15BD6 /* CodyncBot-pebble-Ink.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "CodyncBot-pebble-Ink.ttf"; sourceTree = "<group>"; };F6932F782C1B87C9608359A6 /* NotificationService.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NotificationService.swift; sourceTree = "<group>"; };+ F7CAD5C4F330637102B40288 /* CodyncBot-tablet-Tint.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "CodyncBot-tablet-Tint.ttf"; sourceTree = "<group>"; };F99C11684BFBEB49006600A9 /* Session.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Session.swift; sourceTree = "<group>"; };FAB9BDB52C3A9F7B2568A750 /* CodyncWidgets.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CodyncWidgets.swift; sourceTree = "<group>"; };/* End PBXFileReference section */@@ -167,12 +199,36 @@/* End PBXFrameworksBuildPhase section *//* Begin PBXGroup section */+ 05B4E1C6C8B1EEB62B4FFFD0 /* Fonts */ = {+ isa = PBXGroup;+ children = (+ C484135603CEF437C27BE67B /* CodyncBot-blob-Ink.ttf */,+ D0E552136D473567E0C25ED4 /* CodyncBot-blob-Tint.ttf */,+ 5A21538E748C62E82DF7B139 /* CodyncBot-cloud-Ink.ttf */,+ AAD970B8394F4EDFB85A8936 /* CodyncBot-cloud-Tint.ttf */,+ 89A0D530BEF30AF36F9DBEA8 /* CodyncBot-hex-Ink.ttf */,+ D827E43025A592B41CB68EFD /* CodyncBot-hex-Tint.ttf */,+ F4375A206703EC65F0D15BD6 /* CodyncBot-pebble-Ink.ttf */,+ 1FECC371F3CD98687C0B69FA /* CodyncBot-pebble-Tint.ttf */,+ CEF1A5792B9675FDA7E07740 /* CodyncBot-squircle-Ink.ttf */,+ D5F23C3F9FCE63B4AFB4771A /* CodyncBot-squircle-Tint.ttf */,+ 120FD9DBA315A6DD543463D8 /* CodyncBot-tablet-Ink.ttf */,+ F7CAD5C4F330637102B40288 /* CodyncBot-tablet-Tint.ttf */,+ 203A43D8DF8D3832F95FA837 /* CodyncBot-teardrop-Ink.ttf */,+ C8F46BD8301E7E2C83C35111 /* CodyncBot-teardrop-Tint.ttf */,+ C6B96EE690FC5355C9E3D1B5 /* CodyncBot-wedge-Ink.ttf */,+ C3BB9F034194450254CE14EC /* CodyncBot-wedge-Tint.ttf */,+ );+ path = Fonts;+ sourceTree = "<group>";+ };39BD6D06FC3DE74E5AA24856 /* Resources */ = {isa = PBXGroup;children = (1318104275E5BEC47B7088AD /* Info.plist */,AD18A04CD014230F1B7B0535 /* PrivacyInfo.xcprivacy */,0829A4FCADAC108E8C2DB2F1 /* Widgets.entitlements */,+ 05B4E1C6C8B1EEB62B4FFFD0 /* Fonts */,);path = Resources;sourceTree = "<group>";@@ -459,6 +515,22 @@isa = PBXResourcesBuildPhase;buildActionMask = 2147483647;files = (+ B09F6D6EDC6C6B0B9919D6BF /* CodyncBot-blob-Ink.ttf in Resources */,+ 8B78A34695AD94109AE82C0F /* CodyncBot-blob-Tint.ttf in Resources */,+ B1815C13D0D78E99415C2DC2 /* CodyncBot-cloud-Ink.ttf in Resources */,+ 5CF8180C760CFAE49CF4B8C6 /* CodyncBot-cloud-Tint.ttf in Resources */,+ 198096547EAA6C5FBB68558F /* CodyncBot-hex-Ink.ttf in Resources */,+ BCB60463C96AF5725EC4A2C7 /* CodyncBot-hex-Tint.ttf in Resources */,+ 8B5CCF45DEE9149BB11333C4 /* CodyncBot-pebble-Ink.ttf in Resources */,+ 5FD48874687C2D18B31C7C01 /* CodyncBot-pebble-Tint.ttf in Resources */,+ 4C9ADD8046382132129B1302 /* CodyncBot-squircle-Ink.ttf in Resources */,+ 646410F85B1110297E5F54B9 /* CodyncBot-squircle-Tint.ttf in Resources */,+ 0C920E4962F182ADF75670C5 /* CodyncBot-tablet-Ink.ttf in Resources */,+ FCE6E509AEFC88C3D05D8E3D /* CodyncBot-tablet-Tint.ttf in Resources */,+ 1855DC364C2F8E5B62878BD8 /* CodyncBot-teardrop-Ink.ttf in Resources */,+ E78E3B5FAFEB79F31AAC104D /* CodyncBot-teardrop-Tint.ttf in Resources */,+ B3450CFD87D4096B3BCA7885 /* CodyncBot-wedge-Ink.ttf in Resources */,+ 980C29719BDE2E874C9AD53A /* CodyncBot-wedge-Tint.ttf in Resources */,674BCFBAC7022359FB673FDB /* PrivacyInfo.xcprivacy in Resources */,);runOnlyForDeploymentPostprocessing = 0;diff --git a/apps/ios/Kit/Sources/CodyncKit/Design/ActivityCards.swift b/apps/ios/Kit/Sources/CodyncKit/Design/ActivityCards.swiftindex 6a82869a..68f1ac8b 100644--- a/apps/ios/Kit/Sources/CodyncKit/Design/ActivityCards.swift+++ b/apps/ios/Kit/Sources/CodyncKit/Design/ActivityCards.swift@@ -248,7 +248,7 @@ public struct BotActivityPreview: View {switch form {case .compact:HStack {- ActivityAvatar(shape: bot.avatarShape, color: bot.avatarColor, state: state, size: 20)+ islandFace(20)Spacer(minLength: 70)BotActivityIndicator(state: state)}@@ -260,7 +260,7 @@ public struct BotActivityPreview: View {case .expanded:VStack(spacing: 12) {HStack(spacing: 10) {- ActivityAvatar(shape: bot.avatarShape, color: bot.avatarColor, state: state, size: 26)+ islandFace(26)VStack(spacing: 2) {Text(bot.name).font(.system(size: 14, weight: .semibold)).foregroundStyle(.white)Text(state.caption).font(.system(size: 12)).foregroundStyle(state.captionTint)@@ -275,4 +275,14 @@ public struct BotActivityPreview: View {case .lockScreen: EmptyView()}}++ /// The island plays the working bot's loop (WorkingBotFace in the widget); here the live+ /// avatar stands in for it.+ @ViewBuilder private func islandFace(_ size: CGFloat) -> some View {+ if state.phase == .working {+ CharacterAvatar(shape: bot.avatarShape, color: bot.avatarColor, size: size, mood: .working)+ } else {+ ActivityAvatar(shape: bot.avatarShape, color: bot.avatarColor, state: state, size: size)+ }+ }}diff --git a/apps/ios/Kit/Sources/CodyncKit/Design/CharacterAvatar.swift b/apps/ios/Kit/Sources/CodyncKit/Design/CharacterAvatar.swiftindex 2f6f9318..2d3c415c 100644--- a/apps/ios/Kit/Sources/CodyncKit/Design/CharacterAvatar.swift+++ b/apps/ios/Kit/Sources/CodyncKit/Design/CharacterAvatar.swift@@ -54,14 +54,14 @@ public extension Bot {/// Keep the halftone at every size. Small icons use fewer, larger dots so the/// gaps and hollow eyes survive rasterization in widgets and the Dynamic Island.-private struct Grid {+struct DotGrid {let cells: Intinit(size: CGFloat) { cells = size < 18 ? 7 : size < 28 ? 9 : 13 }var eyeColumns: [Int] { cells == 7 ? [2, 4] : cells == 9 ? [3, 6] : [4, 8] }var eyeRows: [Int] { cells == 13 ? [4, 5, 6] : cells == 9 ? [3, 4] : [2, 3] }}-private struct DottedBody: View {+struct DottedBody: View {let shape: Stringlet color: Colorlet size: CGFloat@@ -98,7 +98,7 @@ private struct DottedBody: View {}var body: some View {- let grid = Grid(size: size)+ let grid = DotGrid(size: size)let step = size / CGFloat(grid.cells)let dots = Self.grid(shape: shape, size: size, step: step, cells: grid.cells)if paused {@@ -136,8 +136,22 @@ private struct DottedBody: View {}}+ /// The working loop the Dynamic Island plays one frame per second (a timer Text in a font+ /// whose digits are these frames; see tools/bot-frame-fonts.py): the light circles the ball+ /// once, the eyes look right, back, left, and blink on the last frame.+ static func workingLoop(shape: String, size: CGFloat) -> [[Ink]] {+ let cells = DotGrid(size: size)+ let step = size / CGFloat(cells.cells)+ let dots = grid(shape: shape, size: size, step: step, cells: cells.cells)+ let glances = [0, 1, 1, 1, 0, -1, -1, -1, 0, 0]+ return glances.indices.map { k in+ let pose = Pose(yaw: -0.7 + Double(k) * 2 * .pi / 10, glance: glances[k], blinking: k == 9)+ return inks(dots, grid: cells, step: step, size: size, pose: pose)+ }+ }+/// Shades the dots as a lit ball; the eyes stay hollow.- static func inks(_ dots: [Dot], grid: Grid, step: CGFloat, size: CGFloat, pose: Pose) -> [Ink] {+ static func inks(_ dots: [Dot], grid: DotGrid, step: CGFloat, size: CGFloat, pose: Pose) -> [Ink] {let eyeRows = pose.blinking ? Array(grid.eyeRows.suffix(1)) : grid.eyeRowslet eyeCols = grid.eyeColumns.map { $0 + pose.glance }let half = size / 2diff --git a/apps/ios/Kit/Tests/CodyncKitTests/ActivityPresentationTests.swift b/apps/ios/Kit/Tests/CodyncKitTests/ActivityPresentationTests.swiftindex 6b7d460f..966e479b 100644--- a/apps/ios/Kit/Tests/CodyncKitTests/ActivityPresentationTests.swift+++ b/apps/ios/Kit/Tests/CodyncKitTests/ActivityPresentationTests.swift@@ -29,7 +29,7 @@ import Testing#expect(BotActivityPresentation(status: "idle", activity: "Old step").caption == "Done")}-@Test func teamWidgetKeepsPicksAndFillsTheRestByUrgency() {+@MainActor @Test func teamWidgetKeepsPicksAndFillsTheRestByUrgency() {let bots = Bot.widgetPreview // review: needs you, build: working, docs: idle#expect(BotsTeamCard.slots(bots: bots, picks: []).map { $0?.id } == ["preview-review", "preview-build", "preview-docs", nil])let picked = BotsTeamCard.slots(bots: bots, picks: [nil, "preview-docs", nil, nil]).map { $0?.id }diff --git a/apps/ios/Kit/Tests/CodyncKitTests/SurfaceRenderTests.swift b/apps/ios/Kit/Tests/CodyncKitTests/SurfaceRenderTests.swiftindex 0be425ca..99648a26 100644--- a/apps/ios/Kit/Tests/CodyncKitTests/SurfaceRenderTests.swift+++ b/apps/ios/Kit/Tests/CodyncKitTests/SurfaceRenderTests.swift@@ -69,3 +69,28 @@ import Testinglet data = try #require(renderer.uiImage?.pngData())try data.write(to: URL(fileURLWithPath: path))}++/// Writes the Dynamic Island's working loop (every shape, 10 frames, in points of a 20 pt face)+/// for tools/bot-frame-fonts.py: `TEST_RUNNER_CODYNC_FRAMES_FILE=<file.json> xcodebuild test …+/// -only-testing:'CodyncKitTests/exportBotFrames()'`.+@MainActor @Test func exportBotFrames() throws {+ guard let file = ProcessInfo.processInfo.environment["CODYNC_FRAMES_FILE"] else { return }+ let shapes = ["blob", "pebble", "squircle", "tablet", "wedge", "hex", "cloud", "teardrop"]+ var out: [String: [[[String: Double]]]] = [:]+ for shape in shapes {+ out[shape] = DottedBody.workingLoop(shape: shape, size: 20).map { frame in+ frame.filter { !$0.eye }.map {+ ["x": $0.dot.center.x, "y": $0.dot.center.y, "r": $0.radius, "ink": $0.ink, "tint": $0.tint]+ }+ }+ }+ let data = try JSONSerialization.data(withJSONObject: ["size": 20, "shapes": out], options: [.sortedKeys])+ try data.write(to: URL(fileURLWithPath: file))+}++/// The loop is ten frames (one per second of a timer digit) and actually moves.+@MainActor @Test func workingLoopHasTenDistinctFrames() {+ let frames = DottedBody.workingLoop(shape: "blob", size: 20)+ #expect(frames.count == 10)+ #expect(frames[0].map(\.radius) != frames[3].map(\.radius))+}diff --git a/apps/ios/Widgets/CodyncWidgets.swift b/apps/ios/Widgets/CodyncWidgets.swiftindex 080e2458..b69468e9 100644--- a/apps/ios/Widgets/CodyncWidgets.swift+++ b/apps/ios/Widgets/CodyncWidgets.swift@@ -595,7 +595,54 @@ struct BotLiveActivity: Widget {.init(status: context.state.status, activity: context.state.activity, isStale: context.isStale)}+ /// While the bot works, the island's face plays its loop; otherwise it holds its mood.+ @ViewBuilderprivate func avatar(_ context: ActivityViewContext<BotActivityAttributes>, state: BotActivityPresentation, size: CGFloat) -> some View {- ActivityAvatar(shape: context.attributes.avatarShape, color: context.attributes.avatarColor, state: state, size: size)+ ZStack {+ if state.phase == .working {+ WorkingBotFace(shape: context.attributes.avatarShape, color: context.attributes.avatarColor,+ since: context.state.startedAt ?? .now, size: size)+ .transition(.opacity)+ } else {+ ActivityAvatar(shape: context.attributes.avatarShape, color: context.attributes.avatarColor, state: state, size: size)+ .transition(.opacity)+ }+ }+ .animation(Motion.activityPhase, value: state.phase)+ }+}++/// The working bot, alive in the Dynamic Island. A Live Activity draws one frame and only a+/// timer keeps changing, so this is a timer drawn in fonts whose digits are the ten frames of+/// the bot's loop (tools/bot-frame-fonts.py); only the seconds digit shows, one frame a second.+/// Two layers, like the app's avatar: every dot in grey ink, the lit ones in the bot's color.+struct WorkingBotFace: View {+ let shape: String+ let color: String+ let since: Date+ let size: CGFloat++ private static let shapes: Set = ["blob", "pebble", "squircle", "tablet", "wedge", "hex", "cloud", "teardrop"]++ var body: some View {+ let shape = Self.shapes.contains(shape) ? shape : "blob"+ ZStack {+ layer("CodyncBot-\(shape)-Ink").foregroundStyle(Palette.text.opacity(0.6))+ layer("CodyncBot-\(shape)-Tint").foregroundStyle(AvatarPalette.color(color))+ }+ .frame(width: size, height: size)+ .clipped()+ .accessibilityHidden(true)+ }++ private func layer(_ font: String) -> some View {+ Text(since, style: .timer)+ .font(.custom(font, fixedSize: size))+ // Western digits whatever the region: the font only has those.+ .environment(\.locale, Locale(identifier: "en_US_POSIX"))+ .multilineTextAlignment(.trailing)+ .lineLimit(1)+ .fixedSize()+ .frame(width: size, height: size, alignment: .trailing)}}diff --git a/apps/ios/Widgets/Resources/Fonts/CodyncBot-blob-Ink.ttf b/apps/ios/Widgets/Resources/Fonts/CodyncBot-blob-Ink.ttfnew file mode 100644index 00000000..d04ced59Binary files /dev/null and b/apps/ios/Widgets/Resources/Fonts/CodyncBot-blob-Ink.ttf differdiff --git a/apps/ios/Widgets/Resources/Fonts/CodyncBot-blob-Tint.ttf b/apps/ios/Widgets/Resources/Fonts/CodyncBot-blob-Tint.ttfnew file mode 100644index 00000000..a54b243fBinary files /dev/null and b/apps/ios/Widgets/Resources/Fonts/CodyncBot-blob-Tint.ttf differdiff --git a/apps/ios/Widgets/Resources/Fonts/CodyncBot-cloud-Ink.ttf b/apps/ios/Widgets/Resources/Fonts/CodyncBot-cloud-Ink.ttfnew file mode 100644index 00000000..a9ea38ecBinary files /dev/null and b/apps/ios/Widgets/Resources/Fonts/CodyncBot-cloud-Ink.ttf differdiff --git a/apps/ios/Widgets/Resources/Fonts/CodyncBot-cloud-Tint.ttf b/apps/ios/Widgets/Resources/Fonts/CodyncBot-cloud-Tint.ttfnew file mode 100644index 00000000..c0be93c5Binary files /dev/null and b/apps/ios/Widgets/Resources/Fonts/CodyncBot-cloud-Tint.ttf differdiff --git a/apps/ios/Widgets/Resources/Fonts/CodyncBot-hex-Ink.ttf b/apps/ios/Widgets/Resources/Fonts/CodyncBot-hex-Ink.ttfnew file mode 100644index 00000000..48fc5d08Binary files /dev/null and b/apps/ios/Widgets/Resources/Fonts/CodyncBot-hex-Ink.ttf differdiff --git a/apps/ios/Widgets/Resources/Fonts/CodyncBot-hex-Tint.ttf b/apps/ios/Widgets/Resources/Fonts/CodyncBot-hex-Tint.ttfnew file mode 100644index 00000000..1f942670Binary files /dev/null and b/apps/ios/Widgets/Resources/Fonts/CodyncBot-hex-Tint.ttf differdiff --git a/apps/ios/Widgets/Resources/Fonts/CodyncBot-pebble-Ink.ttf b/apps/ios/Widgets/Resources/Fonts/CodyncBot-pebble-Ink.ttfnew file mode 100644index 00000000..bff743b0Binary files /dev/null and b/apps/ios/Widgets/Resources/Fonts/CodyncBot-pebble-Ink.ttf differdiff --git a/apps/ios/Widgets/Resources/Fonts/CodyncBot-pebble-Tint.ttf b/apps/ios/Widgets/Resources/Fonts/CodyncBot-pebble-Tint.ttfnew file mode 100644index 00000000..74122977Binary files /dev/null and b/apps/ios/Widgets/Resources/Fonts/CodyncBot-pebble-Tint.ttf differdiff --git a/apps/ios/Widgets/Resources/Fonts/CodyncBot-squircle-Ink.ttf b/apps/ios/Widgets/Resources/Fonts/CodyncBot-squircle-Ink.ttfnew file mode 100644index 00000000..28129909Binary files /dev/null and b/apps/ios/Widgets/Resources/Fonts/CodyncBot-squircle-Ink.ttf differdiff --git a/apps/ios/Widgets/Resources/Fonts/CodyncBot-squircle-Tint.ttf b/apps/ios/Widgets/Resources/Fonts/CodyncBot-squircle-Tint.ttfnew file mode 100644index 00000000..6d64ba6eBinary files /dev/null and b/apps/ios/Widgets/Resources/Fonts/CodyncBot-squircle-Tint.ttf differdiff --git a/apps/ios/Widgets/Resources/Fonts/CodyncBot-tablet-Ink.ttf b/apps/ios/Widgets/Resources/Fonts/CodyncBot-tablet-Ink.ttfnew file mode 100644index 00000000..0af9d052Binary files /dev/null and b/apps/ios/Widgets/Resources/Fonts/CodyncBot-tablet-Ink.ttf differdiff --git a/apps/ios/Widgets/Resources/Fonts/CodyncBot-tablet-Tint.ttf b/apps/ios/Widgets/Resources/Fonts/CodyncBot-tablet-Tint.ttfnew file mode 100644index 00000000..5f574491Binary files /dev/null and b/apps/ios/Widgets/Resources/Fonts/CodyncBot-tablet-Tint.ttf differdiff --git a/apps/ios/Widgets/Resources/Fonts/CodyncBot-teardrop-Ink.ttf b/apps/ios/Widgets/Resources/Fonts/CodyncBot-teardrop-Ink.ttfnew file mode 100644index 00000000..3a00ff14Binary files /dev/null and b/apps/ios/Widgets/Resources/Fonts/CodyncBot-teardrop-Ink.ttf differdiff --git a/apps/ios/Widgets/Resources/Fonts/CodyncBot-teardrop-Tint.ttf b/apps/ios/Widgets/Resources/Fonts/CodyncBot-teardrop-Tint.ttfnew file mode 100644index 00000000..521ca310Binary files /dev/null and b/apps/ios/Widgets/Resources/Fonts/CodyncBot-teardrop-Tint.ttf differdiff --git a/apps/ios/Widgets/Resources/Fonts/CodyncBot-wedge-Ink.ttf b/apps/ios/Widgets/Resources/Fonts/CodyncBot-wedge-Ink.ttfnew file mode 100644index 00000000..ee4482b8Binary files /dev/null and b/apps/ios/Widgets/Resources/Fonts/CodyncBot-wedge-Ink.ttf differdiff --git a/apps/ios/Widgets/Resources/Fonts/CodyncBot-wedge-Tint.ttf b/apps/ios/Widgets/Resources/Fonts/CodyncBot-wedge-Tint.ttfnew file mode 100644index 00000000..cca5a4beBinary files /dev/null and b/apps/ios/Widgets/Resources/Fonts/CodyncBot-wedge-Tint.ttf differdiff --git a/apps/ios/Widgets/Resources/Info.plist b/apps/ios/Widgets/Resources/Info.plistindex 8246c8b6..f2303c4b 100644--- a/apps/ios/Widgets/Resources/Info.plist+++ b/apps/ios/Widgets/Resources/Info.plist@@ -4,6 +4,26 @@<dict><key>CodyncKeychainGroup</key><string>$(AppIdentifierPrefix)com.pokai.Codync</string>+ <!-- The Dynamic Island's animated bot faces (tools/bot-frame-fonts.py). -->+ <key>UIAppFonts</key>+ <array>+ <string>CodyncBot-blob-Ink.ttf</string>+ <string>CodyncBot-blob-Tint.ttf</string>+ <string>CodyncBot-cloud-Ink.ttf</string>+ <string>CodyncBot-cloud-Tint.ttf</string>+ <string>CodyncBot-hex-Ink.ttf</string>+ <string>CodyncBot-hex-Tint.ttf</string>+ <string>CodyncBot-pebble-Ink.ttf</string>+ <string>CodyncBot-pebble-Tint.ttf</string>+ <string>CodyncBot-squircle-Ink.ttf</string>+ <string>CodyncBot-squircle-Tint.ttf</string>+ <string>CodyncBot-tablet-Ink.ttf</string>+ <string>CodyncBot-tablet-Tint.ttf</string>+ <string>CodyncBot-teardrop-Ink.ttf</string>+ <string>CodyncBot-teardrop-Tint.ttf</string>+ <string>CodyncBot-wedge-Ink.ttf</string>+ <string>CodyncBot-wedge-Tint.ttf</string>+ </array><key>NSExtension</key><dict><key>NSExtensionPointIdentifier</key>diff --git a/docs/design/mobile-widgets.md b/docs/design/mobile-widgets.mdindex 14cb5dba..55ea7629 100644--- a/docs/design/mobile-widgets.md+++ b/docs/design/mobile-widgets.md@@ -61,6 +61,8 @@ State 分頁的 Live Activity 頁顯示鎖定畫面形式,Dynamic Island 頁狀態色:待回應琥珀(`Palette.attention`)、失敗紅、完成綠;工作中的說明維持灰色,只有需要注意的狀態跳出來。經過時間用 `Text(startedAt, style: .timer)` 由系統自己往上數,不需要推播(`startedAt` 已在 remote content state 裡)。狀態切換時動的是 bot 本身:每個 mood 有固定的一幀姿勢(idle 光從左上、working 光掃到右側且眼睛往右看、needs you 正面光加漣漪),`still: true` 時每顆點是獨立的 view,系統會逐點插值大小與顏色,所以 halftone 的亮處會滑到新位置、眼睛移過去(`Motion.activityPhase`)。右側的 orb/勾號/警告只做淡入淡出。文字用 `.contentTransition(.interpolate)`,Review/時間列由下往上進場。全部在 iOS 給 activity 更新的 2 s 內,而且只用內建 transition,因為 Live Activity 不執行自訂 transition。展開島底部的時間是單一置中 Text(圖示內嵌),避免 timer Text 佔滿寬度後偏左。Review 只開啟對話,核准仍在 App 的 permission card。+**動態島上工作中的 bot 會動**:Live Activity 只畫一幀,唯一會自己更新的是計時器文字,所以 Compact 與 Expanded 的頭像在 working 時是一個從 `startedAt` 起算的 timer `Text`,用自訂字型畫:字型裡 `0`–`9` 是 bot 工作迴圈的十格(光繞球一圈、眼睛右看→回正→左看、最後一格眨眼),只露出秒數最後一位,所以每秒換一格、十秒一輪。每種外型兩套字型疊起來(`Ink` 灰點、`Tint` 亮點上 bot 顏色),共 16 個 TTF 在 `apps/ios/Widgets/Resources/Fonts/`,由 widget 的 `UIAppFonts` 載入。格子來自 App 自己的繪圖(`DottedBody.workingLoop`),改了頭像畫法要重產:先跑 `exportBotFrames()` 測試輸出 JSON,再跑 `tools/bot-frame-fonts.py`(步驟寫在檔頭)。這只用公開 API(自訂字型 + timer Text),不是 Apple 文件化的動畫方式,未來 iOS 改了 timer 的繪製可能失效;其他狀態與 Lock Screen 仍是靜態姿勢。+模擬器截圖看不到 Live Activity,所以 Live Activity、動態島(各狀態 × Lock Screen/Compact/Minimal/Expanded,淺色與深色)和 widget 卡片改用 render 測試輸出 PNG 檢查:```shdiff --git a/tools/bot-frame-fonts.py b/tools/bot-frame-fonts.pynew file mode 100755index 00000000..c1761012--- /dev/null+++ b/tools/bot-frame-fonts.py@@ -0,0 +1,87 @@+#!/usr/bin/env python3+"""Builds the Dynamic Island's animated bot faces as fonts.++Live Activities draw one frame and only a timer Text keeps updating, so the working bot is a+timer whose seconds digit is drawn in a font where `0`–`9` are the ten frames of its loop.+Two fonts per character shape, stacked in the widget: `Ink` (every dot, tinted grey) and+`Tint` (the lit dots, tinted in the bot's color).++The frames come from the app's own drawing code (CharacterAvatar.swift, `workingLoop`):++ cd apps/ios/Kit && TEST_RUNNER_CODYNC_FRAMES_FILE=/tmp/frames.json xcodebuild test \+ -scheme CodyncKit-Package -derivedDataPath ../../../build/dd \+ -destination 'platform=iOS Simulator,id=<sim>' '-only-testing:CodyncKitTests/exportBotFrames()'+ tools/bot-frame-fonts.py /tmp/frames.json apps/ios/Widgets/Resources/Fonts+"""++import json+import math+import sys+from pathlib import Path++from fontTools.fontBuilder import FontBuilder+from fontTools.pens.ttGlyphPen import TTGlyphPen++EM = 1000+DIGITS = ["zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"]+# A lit dot joins the color layer above this much of the bot's color.+TINT_THRESHOLD = 0.35+++def circle(pen, cx, cy, r):+ """A clockwise circle of eight off-curve points (TrueType quadratics)."""+ k = r / math.cos(math.pi / 8)+ points = [(cx + k * math.cos(-i * math.pi / 4), cy + k * math.sin(-i * math.pi / 4)) for i in range(8)]+ pen.qCurveTo(*[(round(x), round(y)) for x, y in points], None)+ pen.closePath()+++def glyph(dots, size):+ pen = TTGlyphPen(None)+ scale = EM / size+ for d in dots:+ circle(pen, d["x"] * scale, (size - d["y"]) * scale, d["r"] * scale)+ return pen.glyph()+++def empty():+ return TTGlyphPen(None).glyph()+++def build(name, frames, size, out):+ separators = {"space": " ", "colon": ":", "period": ".", "comma": ","}+ order = [".notdef", *separators, *DIGITS]+ glyphs = {g: empty() for g in [".notdef", *separators]}+ for digit, dots in zip(DIGITS, frames):+ glyphs[digit] = glyph(dots, size)+ fb = FontBuilder(EM, isTTF=True)+ fb.setupGlyphOrder(order)+ cmap = {ord(c): g for g, c in separators.items()}+ cmap.update({ord(str(i)): DIGITS[i] for i in range(10)})+ fb.setupCharacterMap(cmap)+ fb.setupGlyf(glyphs)+ # Digits are one face wide; separators take no room, so the last digit sits flush right.+ metrics = {g: (EM if g in DIGITS else 0, 0) for g in order}+ fb.setupHorizontalMetrics(metrics)+ fb.setupHorizontalHeader(ascent=EM, descent=0)+ fb.setupOS2(sTypoAscender=EM, sTypoDescender=0, sTypoLineGap=0, usWinAscent=EM, usWinDescent=0)+ fb.setupNameTable({"familyName": name.replace("-", " "), "styleName": "Regular", "psName": name})+ fb.setupPost()+ fb.save(out / f"{name}.ttf")+++def main():+ frames_file, out_dir = Path(sys.argv[1]), Path(sys.argv[2])+ data = json.loads(frames_file.read_text())+ size = data["size"]+ out_dir.mkdir(parents=True, exist_ok=True)+ for shape, frames in sorted(data["shapes"].items()):+ assert len(frames) == 10, f"{shape}: a timer digit needs 10 frames"+ build(f"CodyncBot-{shape}-Ink", frames, size, out_dir)+ lit = [[d for d in f if d["tint"] > TINT_THRESHOLD] for f in frames]+ build(f"CodyncBot-{shape}-Tint", lit, size, out_dir)+ print(f"wrote {2 * len(data['shapes'])} fonts to {out_dir}")+++if __name__ == "__main__":+ main()