mirror of
https://github.com/stablyai/orca.git
synced 2026-11-15 02:17:31 +00:00
* Advertise mid-turn queueing as queued-messages.v2 Released clients read the v1 name with an unfinished queue UI; they never see v2 and keep sending immediately. (cherry picked from commitf39382e090) * Let each desktop send choose queue or steer while the agent works The follow-up choice is now a Queue / Steer setting saved under nativeChatFollowUpBehavior, Steer by default; the old nativeChatQueueFollowUps switch, which every install saved as true while queueing was dark, is retired on load. Every reader goes through native-chat-follow-up-behavior. While the agent works, Enter follows the setting and Cmd/Ctrl+Enter sends the draft the other way; the alternate flips the setting before the queue's own rules (a waiting command still queues, prompts no one here can answer still send now) and never applies while Stopping. Cmd/Ctrl+Shift+Enter steers the head card only and leaves the draft. An idle agent's card reads Send, and the card menu no longer offers "Turn off queueing". (cherry picked from commit55b48694e7) * Hold Send on the phone to queue or steer a message mid-turn While the agent works on a host that queues, holding Send opens a Queue / Steer sheet; a choice other than the host's setting sends the alternate, resolved against the chat as it is when it lands, by the desktop's rule. Release and dismiss send nothing. The phone reads the host's new follow-up setting (absent reads as Steer), and an idle agent's card reads Send. (cherry picked from commitdb87cf51ea) * Read the follow-up default from one place on desktop and phone (cherry picked from commit8e1438bfb6) * Keep phone follow-up choices aligned with live host state (cherry picked from commitdc9215be3d) * Update stream and wire fixtures for live follow-up preferences (cherry picked from commite4d038cf0b) * Document minimal runtime test fixture assertions (cherry picked from commit254f751ef3) * Keep mobile preference tests in the mobile compiler project (cherry picked from commitae2aa8910e) * feat(native-chat): queue follow-ups by default with a toggle (cherry picked from commit70969d6a43) * test(mobile): assert shared preference renders on real changes (cherry picked from commit3f50de9b2a) * Remove obsolete follow-up option translations (cherry picked from commitb87b360cf3) * Describe Cmd/Ctrl+Enter relative to the Queue follow-ups switch The Settings description said Cmd/Ctrl+Enter sends into the running turn, which is wrong while the switch is off. Describe it as doing the opposite for one message, in every language. * Show what a mid-turn phone Send does, and offer the other way only when it differs While the agent works, the phone's Send button now shows Queue or Steer. Holding it lists that action first with a check and the other second, each with a one-line description, and appears only when both choices would actually lead to different sends. A waiting command or prompts nobody here can answer make a hold behave like a tap. * Steer the head card once while its shortcut is held Holding Cmd/Ctrl+Shift+Enter auto-repeats the key, which steered each card that became the head in turn. Ignore the repeats. * Show beside Stop what Enter does while the agent works While a turn runs and the draft has something to send, a send control now sits beside Stop. Its icon and label say whether Enter queues the message or steers it into the running turn, and its tooltip names Enter and, when it would send differently, Cmd/Ctrl+Enter. Clicking it sends as Enter does. Stop keeps its place and nothing changes while Stopping, with an empty draft, or before the host says it queues. The phone and desktop now read what a send does from one shared helper over the send's own resolver. * Test the send keys and Queue follow-ups search against real wiring One desktop test drives Enter and Cmd+Enter through the real composer, transport and session to the outgoing send and checks its delivery with queueing on and off. Settings search is checked against the capability list this build's host advertises. * Move the composer's send-hold check into its own helper The pane had grown past the file length limit after the main merge. * Disable the mid-turn Queue/Steer button whenever Send would be disabled While an image is still loading, another device holds the input, or a send is blocked for a stated reason, the button beside Stop is now disabled and says why, the same way the idle Send button does. Before, it stayed clickable and a click did nothing. * Hide the mid-turn Queue/Steer button in goal mode In goal mode Enter sets the goal, so a button promising to queue or steer the message was wrong. It is now hidden there, as it already is while editing a queued message. * Fix the Russian queue hint to say the message runs after this turn It read as queueing until the end of this turn. * Stub window.api without a type assertion in the Queue follow-ups settings search test * Pass sendHeld to the composer field in tests and drop an unknown setting from the German Queue test * Let Cmd-click (Ctrl-click elsewhere) on the mid-turn Queue/Steer button send the other way, like Cmd/Ctrl+Enter The button shows the other action while the modifier is held, and its tooltip names the click. Only when the other way would send differently; otherwise a modified click is a plain send. * Merge the duplicate composer-types import and give the composer's round buttons a Button size instead of restyling them The focused code-quality check rejects importing one module twice, and the design-system check rejects rounded-full on a <Button>, which the new Queue/Steer button copied from Send. Both composer buttons now use a round icon size on the Button primitive and render as before. * Share one window key listener across every chat's Queue/Steer button, and count Cmd/Ctrl as held only from its own key press Each mounted chat with a mid-turn draft used to add its own window key listeners, so every keystroke did work per chat, hidden tabs included. One shared listener set now serves them all and wakes a button only when the held state really changes. Other keys can now only clear the held state, so a dictation paste that leaves the Cmd flag on later key events no longer flips the button with Cmd up. Also tests the Ctrl-click on Windows and Linux. * Remove the desktop Queue/Steer button shown beside Stop while the agent works While the agent works, the desktop composer goes back to its usual controls: Stop, with Enter and the send shortcuts doing what they did. Enter still follows the queue setting, Cmd/Ctrl+Enter still sends one message the other way, and Cmd/Ctrl+Shift+Enter still steers the first queued card. This also removes what only that button used: its Cmd/Ctrl-click alternate, the shared Cmd/Ctrl key listener, the extra round Button size, the send-preview value the desktop session passed to the composer, and the button's text in every language. The phone is unchanged. * Put the composer's send-hold checks back inline in the pane The separate send-hold helper only existed because the removed mid-turn Queue/Steer button pushed the pane over the file-length limit. Without the button the pane fits again, so it goes back to main's inline code.
106 lines
4.0 KiB
TypeScript
106 lines
4.0 KiB
TypeScript
import type { CreateWorktreeResult } from './worktree/create-types'
|
|
import type {
|
|
WorktreeDefaultTabsLaunch,
|
|
WorktreeSetupLaunch,
|
|
WorktreeStartupLaunch
|
|
} from './worktree/launch-types'
|
|
import type { SshConnectionState } from './ssh-types'
|
|
import type { TerminalSideEffectBatch } from './terminal-side-effect-facts'
|
|
import type { RuntimeNativeChatLaunchDraftResolution } from './runtime-types'
|
|
import type { RuntimeNavigationTarget } from './runtime-navigation'
|
|
import type { WorktreeSortOrderUpdate } from './worktree/sort-order-update'
|
|
import type { SidebarInputsChangedEvent } from './sidebar-list/sidebar-inputs-feed-contract'
|
|
|
|
export type RuntimeClientEvent =
|
|
| { type: 'reposChanged' }
|
|
| { type: 'nativeChatQueueFollowUpsChanged'; queueFollowUps: boolean }
|
|
/** The Workspace options UI state changed; a mirroring phone re-reads it. */
|
|
| { type: 'workspaceViewChanged' }
|
|
| {
|
|
type: 'worktreesChanged'
|
|
repoId: string
|
|
sortOrderOnly?: boolean
|
|
// Why: lets a client patch an order save in place instead of refetching the repo (#27268).
|
|
sortOrders?: WorktreeSortOrderUpdate[]
|
|
}
|
|
| ({ type: 'nativeChatLaunchDraftResolved' } & RuntimeNativeChatLaunchDraftResolution)
|
|
| { type: 'terminalSideEffects'; batch: TerminalSideEffectBatch }
|
|
/** Only while this host's own phone reads the sidebar feed; every other reader drops it. */
|
|
| SidebarInputsChangedEvent
|
|
// Paired clients lack ssh:state-changed IPC; publish host SSH transitions so their reconnect overlays update (STA-1468).
|
|
| { type: 'sshStateChanged'; targetId: string; state: SshConnectionState }
|
|
| {
|
|
type: 'worktreeTerminalSleepState'
|
|
worktreeId: string
|
|
generation: number
|
|
phase: 'started' | 'committed' | 'cancelled' | 'woken'
|
|
ptyIds: string[]
|
|
terminalHandles: string[]
|
|
}
|
|
// Only the owning automation authority can announce definition/run/usage writes.
|
|
| {
|
|
type: 'automationsChanged'
|
|
selector?: { kind: 'self' } | { kind: 'ssh'; targetId: string } | { kind: 'orphan' }
|
|
reason?: 'definition' | 'run' | 'usage'
|
|
}
|
|
// Why: browser profiles live on the host; old clients drop the unknown type and refetch on their old triggers.
|
|
| { type: 'browserProfilesChanged' }
|
|
| {
|
|
type: 'linearLinkedIssueUpdated'
|
|
worktreeId: string
|
|
identifier: string
|
|
workspaceId: string
|
|
}
|
|
| {
|
|
type: 'activateWorktree'
|
|
repoId: string
|
|
worktreeId: string
|
|
setup?: WorktreeSetupLaunch
|
|
startup?: WorktreeStartupLaunch
|
|
defaultTabs?: WorktreeDefaultTabsLaunch
|
|
providesInitialSurface?: boolean
|
|
/** Absent on older hosts; clients must not infer navigation intent from a broadcast. */
|
|
navigation?: RuntimeNavigationTarget
|
|
}
|
|
|
|
export type RuntimeClientEventStreamMessage =
|
|
| ({ type: 'ready'; subscriptionId: string } & {
|
|
snapshot?: {
|
|
nativeChatQueueFollowUps?: boolean
|
|
repos?: unknown[]
|
|
sshStates?: { targetId: string; state: SshConnectionState }[]
|
|
}
|
|
})
|
|
| RuntimeClientEvent
|
|
| { type: 'end' }
|
|
|
|
export type RuntimeActivateWorktreeEvent = Extract<RuntimeClientEvent, { type: 'activateWorktree' }>
|
|
|
|
export type AutomationsChangedEvent = Extract<RuntimeClientEvent, { type: 'automationsChanged' }>
|
|
|
|
/** Publisher payload; `selector` scoping is added by a later host-scope step. */
|
|
export type AutomationsChangedPayload = Omit<AutomationsChangedEvent, 'type'>
|
|
|
|
export type PublishAutomationsChanged = (payload: AutomationsChangedPayload) => void
|
|
|
|
export function toRuntimeActivateWorktreeEvent(
|
|
repoId: string,
|
|
worktreeId: string,
|
|
setup?: CreateWorktreeResult['setup'],
|
|
startup?: WorktreeStartupLaunch,
|
|
defaultTabs?: CreateWorktreeResult['defaultTabs'],
|
|
navigation?: RuntimeNavigationTarget,
|
|
providesInitialSurface?: boolean
|
|
): RuntimeActivateWorktreeEvent {
|
|
return {
|
|
type: 'activateWorktree',
|
|
repoId,
|
|
worktreeId,
|
|
...(navigation ? { navigation } : {}),
|
|
...(setup ? { setup } : {}),
|
|
...(startup ? { startup } : {}),
|
|
...(defaultTabs ? { defaultTabs } : {}),
|
|
...(providesInitialSurface ? { providesInitialSurface } : {})
|
|
}
|
|
}
|