Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,14 @@ change in both repos.
Discuss puts it in the message box (`ChatModel.boardCardDraft`). Let's do it sends "Let's do it!"
with the idea at once (`leaveComposerText(sendsAtOnce:)`, `ChatModel.sendFromOutside`), never
touching the box, and the idea moves to Ideas › Completed (the plugin's `answer`, `answeredAt`).
- Goal categories belong to the computer, not the app (plugin `native-goal-categories-v1`,
`GoalCategoryInfo`): one list for every bot on it, the built-in seven until someone changes it.
`board/list` sends it with the goals, and each goal says where it shows now (`categoryName`,
`categoryIcon`), so Today and a chat card need no list. Goals › Edit categories
(`GoalCategoriesSheet`) adds, renames and deletes through `board/categories`; the bot does the same
with its board tool. A category's `id` never changes, so a rename keeps its goals. A deleted
category's goals show under Other, which is always last and never changes. `GoalCategory` is only
the built-in seven (symbols, blueprints, the words for a goal with no category).
- New chat is the new chat's own screen, drawn by the ordinary chat (`ChatNewChatSlot`, handed only to the chat
whose ID is `NewChatSession.conversationID`, never decided from its messages; from the first message on, staged,
sending or sent, it's an ordinary chat). Under Back and ⋯ a To row (`NewChatToRow`) holds the picked bots as
Expand Down Expand Up @@ -420,6 +428,17 @@ change in both repos.
the chat when it's free; one made while the chat works runs at once as a Hermes background task for it
(`ChatModel.runNativeVoiceRequest`, `prompt.background`) and answers the call on its own. Background tasks
can't reach the phone's tools.
- **A call continues its chat, both ways** (plugin `native-voice-history-v1`): the plugin reads the chat the
offer names (its newest messages with their roles, its compaction summary, the request still running) into
every provider's instructions before the voice model listens. Each finished line of the call (person or
voice model, a cut-off reply marked `interrupted`) goes back into the chat as an ordinary message through
`voice/transcript` (`LiveVoiceSpokenTurns`), which runs nothing and saves each line once. The plugin writes
only while no turn runs (`voice_chat_busy`), so the journal sends the same lines again until the chat takes
them, over whatever connection to that computer is current. One journal per computer, agent and chat: a new
call's offer waits for an earlier call's lines (2 s at most), and a request waits for the lines before it
(1.5 s at most), so they usually go in first. A cut-off marks only a reply whose words were coming in. On
Gemini a hang-up saves what was still being said (`GeminiLiveTranslator.hangUp`); GPT-Live's last words can
be lost if their event hasn't come when the call closes.
- **On-device voices** (`Bighelp/Voice/OnDevice/`): Phonon speaks on the iPhone or iPad instead of the
computer. It's chosen per agent in Voice settings and kept on the device (`OnDeviceVoiceChoices`, by computer
and agent); the agent's `tts.*` on the computer never changes. `OnDeviceVoiceSettingsClient` adds it to the
Expand Down
16 changes: 16 additions & 0 deletions Bighelp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@
1C2BB4E83D031A33B376321C /* BighelpShortcutService+Actions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19D7160AE9C689BF3CA8ECC8 /* BighelpShortcutService+Actions.swift */; };
1C583C9DF419F0654D7CDC02 /* DevFactoryStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0434D211AF76E67D497A6E46 /* DevFactoryStore.swift */; };
1C763567CD9CCE8F93EA60F8 /* HostSignInMatrixUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37C85FB08FD771ED53292DB4 /* HostSignInMatrixUITests.swift */; };
1C9D4B5D6383FA47982722F7 /* LiveVoiceSpokenTurns.swift in Sources */ = {isa = PBXBuildFile; fileRef = 743E14DEEDCC37C613D31F30 /* LiveVoiceSpokenTurns.swift */; };
1CAD3F56F34703C56D4795E1 /* DirectHermesProjectClientTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = E2F8FB47038C2E9A1EE89696 /* DirectHermesProjectClientTests.swift */; };
1CBBCA37E4825CA82FAB683F /* SimpleBotProfileExtras.swift in Sources */ = {isa = PBXBuildFile; fileRef = D51BF68C15E152807C58243B /* SimpleBotProfileExtras.swift */; };
1CBFD9B876E36D5544E7129A /* ChatsInboxView.swift in Sources */ = {isa = PBXBuildFile; fileRef = AA031A13A7DDB2CCF96B99A3 /* ChatsInboxView.swift */; };
Expand Down Expand Up @@ -1150,6 +1151,7 @@
86828616C0652504329CA63E /* AgentDeletionUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DD268648AC84425AD755C76C /* AgentDeletionUITests.swift */; };
86ED398D440A6A5D23CAD0B9 /* UsageStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = D04DCAF7F90EF8190BB0B2A2 /* UsageStore.swift */; };
873627A0788894E370CA1D86 /* NeedsYouBlueprintsModesTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0CC87D2B2C1511FADA193002 /* NeedsYouBlueprintsModesTests.swift */; };
875482724CAF36C8C2C38163 /* GoalCategories.swift in Sources */ = {isa = PBXBuildFile; fileRef = DB2E925280D6719953ECDF47 /* GoalCategories.swift */; };
879E33489356FF40A206B326 /* CapabilitiesManagementView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 12D93519128F8E3A35F264D0 /* CapabilitiesManagementView.swift */; };
879F26B5861D37C7F19A5099 /* SubagentCanvasTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D9853597BF6721C1FFA38C43 /* SubagentCanvasTests.swift */; };
8807CDF7B4E669D5B8F7BE38 /* ReferenceGitHubAdapterSnapshot.swift in Sources */ = {isa = PBXBuildFile; fileRef = FB4F78E4AFF7D918C452079F /* ReferenceGitHubAdapterSnapshot.swift */; };
Expand Down Expand Up @@ -1558,6 +1560,7 @@
B95546BA653AA08075DAAEEB /* SessionContentRepository.swift in Sources */ = {isa = PBXBuildFile; fileRef = 76C2C6940B458C1D6DF15854 /* SessionContentRepository.swift */; };
B96A047D8C3F72D4485B2129 /* ChatReactionBarTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 538EA16267AB77E69A6E9D28 /* ChatReactionBarTests.swift */; };
B98024B47619F441AB7EE964 /* LiveVoiceModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6BFBFE60217D0F9676F7FD23 /* LiveVoiceModel.swift */; };
B99CD603DFAE116B404580FA /* GoalCategoriesSheet.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B586517490B176E94948F05 /* GoalCategoriesSheet.swift */; };
B99CEBCB5650C88D5BA59020 /* OnDeviceVoiceRouting.swift in Sources */ = {isa = PBXBuildFile; fileRef = B1BCC47FB209680A0EF2AAFB /* OnDeviceVoiceRouting.swift */; };
B9A9975B875DC065472E8F68 /* AgentBoardTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC5B91C5A272DC8DA6E437DE /* AgentBoardTests.swift */; };
B9B06D7B27668CF35396371D /* AgentHeroHeaderLayoutTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65BD4C0208441BB886FDB670 /* AgentHeroHeaderLayoutTests.swift */; };
Expand Down Expand Up @@ -1941,6 +1944,7 @@
E631FB670F611061813B80C9 /* ModelNameCatalogTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 06E0752CDEB93F69DFC3661C /* ModelNameCatalogTests.swift */; };
E64170A092AE47599073DA7A /* ChatNewChatSlot.swift in Sources */ = {isa = PBXBuildFile; fileRef = 49C6C5B621D594D25819458C /* ChatNewChatSlot.swift */; };
E64E2686D7C3C64D3E3E529A /* VoiceOptions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 558FB53391D183473F14A43A /* VoiceOptions.swift */; };
E6619435B9EA0C05882CB280 /* LiveVoiceSpokenTurnsTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 32C416483341AB26D7091D6B /* LiveVoiceSpokenTurnsTests.swift */; };
E67563B3E12A73308A799A38 /* AgentTemplateBrowser.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B51E351013BB3D09F5BF96A /* AgentTemplateBrowser.swift */; };
E6B5DA183CBCD546DCAABD9B /* ChatLayoutPreferencesTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = F26A9153E01384FF3334E701 /* ChatLayoutPreferencesTests.swift */; };
E6BE2C3667CEEEBA7A13FB3A /* RichDraftRecoveryStore.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9341CEE698D541FD92FE8E4B /* RichDraftRecoveryStore.swift */; };
Expand Down Expand Up @@ -2691,6 +2695,7 @@
32935F0C3FF3C44EDE17455D /* BighelpInterfaceSize.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BighelpInterfaceSize.swift; sourceTree = "<group>"; };
32A8093F2FE15DF1627DCB77 /* ChatStreamingAnchorUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChatStreamingAnchorUITests.swift; sourceTree = "<group>"; };
32C3489FFED4C0F54190BB0F /* BighelpCardCatalogView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BighelpCardCatalogView.swift; sourceTree = "<group>"; };
32C416483341AB26D7091D6B /* LiveVoiceSpokenTurnsTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LiveVoiceSpokenTurnsTests.swift; sourceTree = "<group>"; };
32CB21AAA8E67876D78BC09D /* ThinkingLadder.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ThinkingLadder.swift; sourceTree = "<group>"; };
32E521E0B53082AC36D71775 /* HermesBlobEditsTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HermesBlobEditsTests.swift; sourceTree = "<group>"; };
33254D4EC0561796677A14F8 /* ClipboardAttachmentTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ClipboardAttachmentTests.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -3170,6 +3175,7 @@
6AC7DF2F678C14DF3F82F320 /* SessionSubagentPresentation.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SessionSubagentPresentation.swift; sourceTree = "<group>"; };
6ADD22141655C8ECEAAAFF20 /* FixtureWorkspaceManagementClient.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FixtureWorkspaceManagementClient.swift; sourceTree = "<group>"; };
6B51E351013BB3D09F5BF96A /* AgentTemplateBrowser.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AgentTemplateBrowser.swift; sourceTree = "<group>"; };
6B586517490B176E94948F05 /* GoalCategoriesSheet.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GoalCategoriesSheet.swift; sourceTree = "<group>"; };
6B7A896B2C3D652785254B28 /* SystemPageUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SystemPageUITests.swift; sourceTree = "<group>"; };
6BAB935FB2C454D6B7A963BB /* NewChatCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NewChatCoordinator.swift; sourceTree = "<group>"; };
6BBEA79EA71E6E0E9A00BE02 /* draft-save-code.json */ = {isa = PBXFileReference; lastKnownFileType = text.json; path = "draft-save-code.json"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -3235,6 +3241,7 @@
73FA2398602D858EDB43E766 /* DeviceFocusToolTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DeviceFocusToolTests.swift; sourceTree = "<group>"; };
7437B65BFB4AFEE0CCB68086 /* BighelpActivityAvatarWriter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BighelpActivityAvatarWriter.swift; sourceTree = "<group>"; };
743A8422BB20CF6C30B55B4B /* SettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsView.swift; sourceTree = "<group>"; };
743E14DEEDCC37C613D31F30 /* LiveVoiceSpokenTurns.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LiveVoiceSpokenTurns.swift; sourceTree = "<group>"; };
7445286B80C4CA76D5634B40 /* PermissionsViews.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PermissionsViews.swift; sourceTree = "<group>"; };
7459CDC081DDB6A14E0C9F21 /* ChatCompactionTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ChatCompactionTests.swift; sourceTree = "<group>"; };
74707D0902600D341422EDD9 /* SessionEditorTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SessionEditorTests.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -4101,6 +4108,7 @@
DAED33EFE39C435EEECF5599 /* BighelpPersonID.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BighelpPersonID.swift; sourceTree = "<group>"; };
DB0C6B1B426629EDA96C7ACC /* BighelpLiveActivityLog.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BighelpLiveActivityLog.swift; sourceTree = "<group>"; };
DB11B9CD72BA82F3CF4FC06E /* BotLook.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BotLook.swift; sourceTree = "<group>"; };
DB2E925280D6719953ECDF47 /* GoalCategories.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GoalCategories.swift; sourceTree = "<group>"; };
DB2FF592B8A04DEEFD7B17AF /* AgentMediaTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AgentMediaTests.swift; sourceTree = "<group>"; };
DB640E443FE6AB3A381C1FFD /* AgentStudioCaption.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AgentStudioCaption.swift; sourceTree = "<group>"; };
DB83B642C9FCC3341B0169D4 /* BighelpSkeleton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BighelpSkeleton.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -4793,6 +4801,8 @@
FCC640306666832EF7BEC2A0 /* DashboardActivityDetailView.swift */,
37D2DE1F0AF4478D40FD0E25 /* DashboardTodaySection.swift */,
14791450B5A4D6CE103EC937 /* FeedPostFiles.swift */,
DB2E925280D6719953ECDF47 /* GoalCategories.swift */,
6B586517490B176E94948F05 /* GoalCategoriesSheet.swift */,
D927E9C5B53DDE1797A520AD /* IslandStage.swift */,
A44223CB9667024350A9D441 /* TemplateCatalogStore.swift */,
CF9F2674039531137409B7D7 /* TemplateCategories.swift */,
Expand Down Expand Up @@ -5963,6 +5973,7 @@
426C42D8F875320110D6639E /* LiveVoiceDebugTests.swift */,
930BE7C3699C14551E96C567 /* LiveVoiceFailureRecoveryTests.swift */,
F50CA5FA31F95111A047BE14 /* LiveVoiceReadinessTests.swift */,
32C416483341AB26D7091D6B /* LiveVoiceSpokenTurnsTests.swift */,
8AE3F5EF033F2E51AC96DFFA /* LiveVoiceUnavailableTests.swift */,
A24F8EDFED2D47FDF964F65C /* LocalizationTests.swift */,
8B9BFECF9345E2D8DC72595E /* LongTextEditorTests.swift */,
Expand Down Expand Up @@ -6600,6 +6611,7 @@
E2733FF4EBE31845361EA75E /* LiveVoiceControlClient.swift */,
109F04DFB422C0BB43066B7A /* LiveVoiceDebug.swift */,
6BFBFE60217D0F9676F7FD23 /* LiveVoiceModel.swift */,
743E14DEEDCC37C613D31F30 /* LiveVoiceSpokenTurns.swift */,
C060C8B5BD2262CCDADA50B1 /* LiveVoiceUnavailable.swift */,
3DE2AFF1D5FD9181A8FD5C0C /* LiveVoiceView.swift */,
F83C6C89073925B7B902D076 /* NativeLiveVoiceSession.swift */,
Expand Down Expand Up @@ -8737,6 +8749,8 @@
27A49B69B97D32CD2A32E649 /* GitHubResource.swift in Sources */,
3DD0EFF0CB0B8EBF4DA5FFDD /* GitHubResourceProvider.swift in Sources */,
B85A12A0BC8811D8CAE73C52 /* GitHubTransport.swift in Sources */,
875482724CAF36C8C2C38163 /* GoalCategories.swift in Sources */,
B99CD603DFAE116B404580FA /* GoalCategoriesSheet.swift in Sources */,
E0E26CC2702BC633B82814BB /* GroupSettingsDemoClient.swift in Sources */,
9D746590A066AA6E8FBAFD33 /* GroupSettingsView.swift in Sources */,
8D1EC9D53AE48FDCEC962091 /* HTMLAppCardView.swift in Sources */,
Expand Down Expand Up @@ -8846,6 +8860,7 @@
FA331C57EB24656B155C52F3 /* LiveVoiceControlClient.swift in Sources */,
2D5C56C4141E0E2AE210CCC1 /* LiveVoiceDebug.swift in Sources */,
B98024B47619F441AB7EE964 /* LiveVoiceModel.swift in Sources */,
1C9D4B5D6383FA47982722F7 /* LiveVoiceSpokenTurns.swift in Sources */,
C8AD5F30F3BF6451299274CB /* LiveVoiceUnavailable.swift in Sources */,
798AB46934955192680B3C22 /* LiveVoiceView.swift in Sources */,
1D0ED381C419538DC3C37394 /* LocalModelsStore.swift in Sources */,
Expand Down Expand Up @@ -9772,6 +9787,7 @@
B31182743F5AB3DE1031179C /* LiveVoiceDebugTests.swift in Sources */,
D2C62A26D889E650BD2ECBE4 /* LiveVoiceFailureRecoveryTests.swift in Sources */,
C5C7D6DF90F63E17E68BD8F9 /* LiveVoiceReadinessTests.swift in Sources */,
E6619435B9EA0C05882CB280 /* LiveVoiceSpokenTurnsTests.swift in Sources */,
BD93F85CEA873C499CE14AEE /* LiveVoiceUnavailableTests.swift in Sources */,
18D4DFDDC85C7D8F532A22BA /* LocalizationTests.swift in Sources */,
0245FA2481F1D25284A33027 /* LongTextEditorTests.swift in Sources */,
Expand Down
38 changes: 37 additions & 1 deletion Bighelp/App/NativeWorkspaceRuntime.swift
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,8 @@ final class NativeWorkspaceRuntime {
let context = LiveVoiceCallContext.offerContext(
features: workspace.nativeContext?.features ?? [], agentName: agent?.name,
personName: { [weak userIdentity] in userIdentity?.identity.name }, place: .shared)
let spoken = Self.spokenTurns(for: voiceOwner, features: workspace.nativeContext?.features ?? [],
connections: connections, authority: authority, chat: chat)
let voice = NativeLiveVoiceSession(owner: voiceOwner, operation: { operation, payload in
try await workspace.perform(operation, payload: payload, owner: owner)
}, isCurrent: { [weak connections] in connections?.owner == owner },
Expand All @@ -476,7 +478,7 @@ final class NativeWorkspaceRuntime {
}, submit: { [weak chat] text in
guard let chat else { throw LiveVoiceControlError.wrongOwner }
return try await chat.runNativeVoiceRequest(text)
}, context: context)
}, context: context, spoken: spoken)
return .success(voice.makeModel(agentName: agent?.name ?? "Hermes"))
}
// Native creation already captures the verified selected cwd before
Expand Down Expand Up @@ -1085,3 +1087,37 @@ private final class ReplyVoiceCache {
return output
}
}

extension NativeWorkspaceRuntime {
/// The journal of what calls say in this chat, for a computer whose plugin saves it there. Each send takes
/// the connection to this computer that is current then, so lines a call left still go in after a
/// reconnect; the chat reads what was saved, so the lines show in it.
static func spokenTurns(for owner: LiveVoiceOwner, features: Set<String>, connections: WorkspaceConnectionStore,
authority: WorkspaceAuthority, chat: ChatModel) -> LiveVoiceSpokenTurns? {
guard features.contains(LiveVoiceSpokenTurns.feature) else { return nil }
let journal = LiveVoiceSpokenTurns.shared(hostID: owner.hostID, agentID: owner.agentID, sessionID: owner.sessionID)
journal.send = { [weak connections] voiceID, lines in
guard let connections, let current = connections.owner, current.authority == authority,
let workspace = connections.workspace,
workspace.nativeContext?.features.contains(LiveVoiceSpokenTurns.feature) == true else { return .wait }
do {
_ = try await workspace.perform(.nativeVoiceTranscript, payload: [
"agentId": .string(owner.agentID), "sessionId": .string(owner.sessionID),
"voiceId": .string(voiceID), "items": .array(lines),
], owner: current)
return .saved
} catch WorkspaceClientError.rejected(let code, _) {
// A running turn holds the chat; anything else it refused, it will refuse again.
return code == "voice_chat_busy" || code == "context_changed" ? .wait : .refused
} catch WorkspaceClientError.capacityExceeded {
return .refused
} catch {
// Also "unavailable": right after a reconnect the features can be unknown for a moment,
// and that is never "this computer can't save them".
return .wait
}
}
journal.onSaved = { [weak chat] in chat?.refreshFromHostSoon() }
return journal
}
}
Loading