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
2 changes: 1 addition & 1 deletion src/main/agent-hooks/managed-hook-detection-commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
import { MANAGED_AGENT_HOOK_TARGETS } from '../../shared/managed-agent-hook-targets'
import { normalizeDisabledTuiAgents } from '../../shared/tui-agent-selection'
import type { GlobalSettings } from '../../shared/global-settings-types'
import type { TuiAgentDetectionCommand } from '../ipc/tui-agent-detection-commands'
import type { TuiAgentDetectionCommand } from '../../shared/tui-agent-detection-commands'
import { parseClaudeCliVersion } from '../claude/claude-hook-event-versions'

export type ManagedHookDetectionSettings = Partial<
Expand Down
4 changes: 3 additions & 1 deletion src/main/ipc/feedback-image-attachments.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ import { describe, expect, it } from 'vitest'
import {
MAX_FEEDBACK_IMAGE_BYTES,
MAX_FEEDBACK_IMAGE_COUNT,
MAX_FEEDBACK_IMAGE_TOTAL_BYTES,
MAX_FEEDBACK_IMAGE_TOTAL_BYTES
} from '../../shared/feedback-image-limits'
import {
appendFeedbackImagesToFormData,
feedbackImageFilename,
isSupportedFeedbackImageContentType,
Expand Down
7 changes: 0 additions & 7 deletions src/main/ipc/feedback-image-attachments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,6 @@ const FEEDBACK_IMAGE_EXTENSIONS: Record<string, string> = {
'image/gif': 'gif'
}

export {
MAX_FEEDBACK_IMAGE_BYTES,
MAX_FEEDBACK_IMAGE_COUNT,
MAX_FEEDBACK_IMAGE_TOTAL_BYTES
} from '../../shared/feedback-image-limits'
export type { FeedbackImageAttachment } from '../../shared/feedback-submit-contract'

export const MAX_FEEDBACK_IMAGE_RESPONSE_BYTES = 64 * 1024
export const FEEDBACK_IMAGE_FORM_FIELD = 'feedbackImage'

Expand Down
2 changes: 0 additions & 2 deletions src/main/ipc/feedback-request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ export type FeedbackSubmitBody = {
images?: FeedbackImageAttachment[]
}

export type { FeedbackRequestFailure } from '../../shared/feedback-submit-contract'

export async function postFeedback(
url: string,
body: FeedbackSubmitBody,
Expand Down
6 changes: 2 additions & 4 deletions src/main/ipc/feedback.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@ vi.mock('electron', () => ({
net: { fetch: (...args: unknown[]) => fetchMock(...args) }
}))

import {
MAX_FEEDBACK_IMAGE_RESPONSE_BYTES,
MAX_FEEDBACK_IMAGE_TOTAL_BYTES
} from './feedback-image-attachments'
import { MAX_FEEDBACK_IMAGE_RESPONSE_BYTES } from './feedback-image-attachments'
import { MAX_FEEDBACK_IMAGE_TOTAL_BYTES } from '../../shared/feedback-image-limits'
import { registerFeedbackHandlers, submitFeedback } from './feedback'

function okResponse(): Response {
Expand Down
17 changes: 7 additions & 10 deletions src/main/ipc/feedback.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import os from 'node:os'
import { app, ipcMain } from 'electron'
import {
readFeedbackImagesDelivered,
validateFeedbackImages,
type FeedbackImageAttachment
} from './feedback-image-attachments'
import { readFeedbackImagesDelivered, validateFeedbackImages } from './feedback-image-attachments'
import type {
FeedbackImageAttachment,
FeedbackRequestFailure,
FeedbackSubmitArgs,
FeedbackSubmitResult
} from '../../shared/feedback-submit-contract'
import {
errorFailure,
FEEDBACK_API_URL,
Expand All @@ -15,11 +17,6 @@ import {
type FeedbackSubmissionType,
type FeedbackSubmitBody
} from './feedback-request'
import type {
FeedbackRequestFailure,
FeedbackSubmitArgs,
FeedbackSubmitResult
} from '../../shared/feedback-submit-contract'

export type {
FeedbackDiagnosticBundleAttachment,
Expand Down
2 changes: 1 addition & 1 deletion src/main/ipc/freebuff-detection.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
getTuiAgentDetectionProbeCommands,
KNOWN_TUI_AGENT_DETECTION_COMMANDS,
resolveDetectedTuiAgentIds
} from './tui-agent-detection-commands'
} from '../../shared/tui-agent-detection-commands'

describe('Freebuff detection', () => {
it.each(['darwin', 'linux', 'win32', 'wsl'] as const)(
Expand Down
1 change: 0 additions & 1 deletion src/main/ipc/local-agent-install-dir-detection.ts

This file was deleted.

1 change: 0 additions & 1 deletion src/main/ipc/notification-burst-cooldown.ts

This file was deleted.

11 changes: 0 additions & 11 deletions src/main/ipc/parcel-watcher-process.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,6 @@ import type {
} from './parcel-watcher-process-subscription'
import { RuntimeWatcherProcessPool } from './runtime-watcher-process-pool'

export type {
WatcherProcessCallback,
WatcherProcessHooks,
WatcherProcessSubscription
} from './parcel-watcher-process-subscription'
export type {
WatcherProcessDeliveryOptions,
WatcherProcessEvent,
WatcherProcessSubscribeOptions
} from './parcel-watcher-process-protocol'

const sharedWatcherProcessSupervisor = new WatcherProcessSupervisor()
// Why: healthy roots share one child; only fault quarantine scales to four,
// containing a failed shard without paying that RSS cost during normal use.
Expand Down
4 changes: 2 additions & 2 deletions src/main/ipc/parcel-watcher-root-path-rewrite.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ import {
resetRuntimeWatcherProcessForTest,
resetWatcherProcessForTest,
subscribeViaRuntimeWatcherProcess,
subscribeViaWatcherProcess,
type WatcherProcessEvent
subscribeViaWatcherProcess
} from './parcel-watcher-process'
import type { WatcherProcessEvent } from './parcel-watcher-process-protocol'

describe('watcher-process root path rewrite', () => {
let root: AliasedWatcherRoot | null = null
Expand Down
1 change: 0 additions & 1 deletion src/main/ipc/plugins.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ const logsArgsSchema = z.object({ pluginKey: z.string().min(1) })

// Why re-exported: moved to ../plugins/plugin-client-list so the runtime RPC can reach
// it without ipcMain. Existing importers of this path keep working.
export { listPluginsForClients } from '../plugins/plugin-client-list'
import { listPluginsForClients } from '../plugins/plugin-client-list'

export function canRemoveInstalledPlugin(
Expand Down
4 changes: 2 additions & 2 deletions src/main/ipc/preflight-agent-detection-no-subprocess.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ vi.mock('../azure-devops/client', () => ({
vi.mock('../gitea/client', () => ({ getGiteaAuthStatus: getGiteaAuthStatusMock }))

// Isolate the subprocess-spawn assertion from the fs-based install-dir fallback.
vi.mock('./local-agent-install-dir-detection', () => ({
vi.mock('../../shared/local-agent-install-dir-detection', () => ({
detectCommandsInInstallDirs: detectCommandsInInstallDirsMock
}))

Expand All @@ -67,7 +67,7 @@ import { _resetPreflightCache, detectInstalledAgents } from './preflight'
import {
getTuiAgentDetectionProbeCommands,
KNOWN_TUI_AGENT_DETECTION_COMMANDS
} from './tui-agent-detection-commands'
} from '../../shared/tui-agent-detection-commands'

describe('#9297: local agent detection spawns zero where/which subprocesses', () => {
const originalPlatform = process.platform
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { describe, expect, it } from 'vitest'
import { PtyPendingDataDrainQueue, type PendingPtyData } from './pty-pending-data-drain-queue'
import { PtyPendingDataDrainQueue } from './pty-pending-data-drain-queue'
import type { PendingPtyData } from './pty-pending-data-drain-contract'

const CHUNK_CHARS = 4
const MAX_WRITES = 2
Expand Down
10 changes: 5 additions & 5 deletions src/main/ipc/pty-pending-data-drain-queue.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { describe, expect, it } from 'vitest'
import {
PtyPendingDataDrainQueue,
type PendingPtyData,
type PtyPendingDataDrainSelection
} from './pty-pending-data-drain-queue'
import { PtyPendingDataDrainQueue } from './pty-pending-data-drain-queue'
import type {
PendingPtyData,
PtyPendingDataDrainSelection
} from './pty-pending-data-drain-contract'

function pending(data: string): PendingPtyData {
return { data }
Expand Down
2 changes: 0 additions & 2 deletions src/main/ipc/pty-pending-data-drain-queue.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import type * as Contract from './pty-pending-data-drain-contract'

export type * from './pty-pending-data-drain-contract'

type LinkedLaneName = Contract.PtyPendingDataDrainDisposition
type NodeLaneName = LinkedLaneName | 'none' | 'selected'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { describe, expect, it } from 'vitest'
import {
PtyPendingDataDrainQueue,
type PendingPtyData,
type PtyPendingDataDrainSelection
} from './pty-pending-data-drain-queue'
import { PtyPendingDataDrainQueue } from './pty-pending-data-drain-queue'
import type {
PendingPtyData,
PtyPendingDataDrainSelection
} from './pty-pending-data-drain-contract'

const CHUNK_CHARS = 4
const MAX_WRITES = 2
Expand Down
2 changes: 1 addition & 1 deletion src/main/ipc/pty/delivery/accounting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
PTY_RENDERER_TOTAL_IN_FLIGHT_HIGH_WATER_CHARS
} from './constants'
import type { PtyIpcSession } from '../session'
import type { PendingPtyData } from '../../pty-pending-data-drain-queue'
import type { PendingPtyData } from '../../pty-pending-data-drain-contract'

export function getRendererInFlightCharsForPty(session: PtyIpcSession, id: string): number {
const accounting = session.rendererDeliveryAccountingByPty.get(id)
Expand Down
2 changes: 1 addition & 1 deletion src/main/ipc/pty/delivery/flush.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
recordHiddenRendererPtyDataDrop,
shouldDropHiddenRendererPtyData
} from '../../pty-hidden-delivery-gate'
import type { PendingPtyData } from '../../pty-pending-data-drain-queue'
import type { PendingPtyData } from '../../pty-pending-data-drain-contract'
import { activeRendererPtys } from './visibility-state'
import {
PTY_BATCH_DRAIN_CONTINUE_MS,
Expand Down
2 changes: 1 addition & 1 deletion src/main/ipc/pty/delivery/pending.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { redactPtyIdForDiagnostics } from '../../../../shared/pty-delivery-diagn
import { recordCrashBreadcrumb } from '../../../crash-reporting/crash-breadcrumb-store'
import { terminalOutputBacklogCapChars } from '../../../../shared/terminal-scrollback-policy'
import { isHiddenPtyDeliveryGateEnabled } from '../../pty-hidden-delivery-gate'
import type { PendingPtyData } from '../../pty-pending-data-drain-queue'
import type { PendingPtyData } from '../../pty-pending-data-drain-contract'
import { DROPPED_QUERY_SALVAGE_MAX_CHARS } from './constants'
import type { PtyIpcSession } from '../session'

Expand Down
6 changes: 3 additions & 3 deletions src/main/ipc/pty/host-env/assembly.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
detectExplicitPiAgentKindFromCommand,
isPiCompatibleAgentType
} from '../../../../shared/pi-agent-kind'
import { applyTerminalGitCredentialPromptGuard } from '../../terminal-git-credential-guard'
import { applyTerminalGitCredentialPromptGuard } from '../../../../shared/terminal-git-credential-guard'
import { ensureOpenCodeStartupPromptForLaunch } from '../../../opencode/opencode-startup-prompt-installer'
import { mimoCodeHookService } from '../../../mimo/hook-service'
import { agentHookServer } from '../../../agent-hooks/server'
Expand All @@ -27,9 +27,9 @@ import {
isMimoLaunchCommand,
resolveMimocodeSourceHome,
resolvePiAgentSourceDir,
resolveScopedPiAgentSourceDir,
restoreOrStripOverlayEnv
resolveScopedPiAgentSourceDir
} from './pi-agent'
import { restoreOrStripOverlayEnv } from '../../../../shared/agent-overlay-env'
import { AGENT_HOOK_RUNTIME_ENV_KEYS } from './spawn-env-keys'
import { applyManagedDataAccountEnvironment } from '../../../managed-data-accounts/launch-environment'
import { applyOpenCodeStatusPluginEnv, captureOpenCodeSourceConfig } from './opencode-config'
Expand Down
3 changes: 2 additions & 1 deletion src/main/ipc/pty/host-env/opencode-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import {
isOpenCodeLegacySharedConfigDir
} from '../../../opencode/legacy-shared-config-dir'
import { openCode2HookService, openCodeHookService } from '../../../opencode/hook-service'
import { resolveOpenCodeSourceConfigDir, restoreOrStripOverlayEnv } from './pi-agent'
import { resolveOpenCodeSourceConfigDir } from './pi-agent'
import { restoreOrStripOverlayEnv } from '../../../../shared/agent-overlay-env'
import { selectOpenCodeHookAgent } from '../../../../shared/opencode-launch-command'
import { isTuiAgentEnabled } from '../../../../shared/tui-agent-selection'
import { resolveOpenCodeConfigDirectory } from '../../../../shared/opencode-config-directory'
Expand Down
2 changes: 0 additions & 2 deletions src/main/ipc/pty/host-env/pi-agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,6 @@ export function getInheritedAgentSessionStampEnvKeysToDelete(
]
}

export { restoreOrStripOverlayEnv } from '../../../../shared/agent-overlay-env'

export function isMimoLaunchCommand(launchCommand: string | undefined): boolean {
return getAgentLaunchExecutableName(launchCommand) === 'mimo'
}
Expand Down
3 changes: 2 additions & 1 deletion src/main/ipc/pty/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import type {
} from '../../../shared/pty-renderer-delivery-health'
import type { PtyRendererDeliveryDebugSnapshot } from './delivery/debug'
import { PtyProducerFlowController } from '../pty-producer-flow-control'
import { PtyPendingDataDrainQueue, type PendingPtyData } from '../pty-pending-data-drain-queue'
import { PtyPendingDataDrainQueue } from '../pty-pending-data-drain-queue'
import type { PendingPtyData } from '../pty-pending-data-drain-contract'
import { activeRendererPtys } from './delivery/visibility-state'
import {
isHiddenPtyDeliveryGateEnabled,
Expand Down
2 changes: 1 addition & 1 deletion src/main/ipc/qoder-desktop-execution-host.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { buildAgentResumeStartupPlan } from '../../shared/tui-agent-startup'
import type { PtySpawnIpcArgs } from './pty/ipc/spawn-types'

vi.mock('./preflight-command-exec', () => ({ isCommandOnPath: vi.fn() }))
vi.mock('./local-agent-install-dir-detection', () => ({
vi.mock('../../shared/local-agent-install-dir-detection', () => ({
detectCommandsInInstallDirs: () => new Set()
}))
vi.mock('./preflight-wsl-agent-detection', () => ({
Expand Down
2 changes: 0 additions & 2 deletions src/main/ipc/runtime-watcher-process-pool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ import {
type RuntimeWatcherProcessPoolOptions
} from './runtime-watcher-pool-state'

export type { RuntimeWatcherProcessPoolOptions } from './runtime-watcher-pool-state'

// Why: extra ~50 MiB processes are justified only when quarantine isolates a fault.
const DEFAULT_MAX_SHARED_SUPERVISORS = 1
const DEFAULT_MAX_QUARANTINE_SUPERVISORS = 4
Expand Down
2 changes: 1 addition & 1 deletion src/main/ipc/terminal-git-credential-guard.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { describe, expect, it } from 'vitest'
import {
applyTerminalGitCredentialPromptGuard,
TERMINAL_GIT_CREDENTIAL_GUARD_POLICY_ENV
} from './terminal-git-credential-guard'
} from '../../shared/terminal-git-credential-guard'

function expectGuarded(env: Record<string, string>): void {
expect(env.GIT_TERMINAL_PROMPT).toBe('0')
Expand Down
4 changes: 0 additions & 4 deletions src/main/ipc/terminal-git-credential-guard.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/main/ipc/tui-agent-detection-commands.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
getTuiAgentDetectionProbeCommands,
KNOWN_TUI_AGENT_DETECTION_COMMANDS,
resolveDetectedTuiAgentIds
} from './tui-agent-detection-commands'
} from '../../shared/tui-agent-detection-commands'

describe('tui agent detection commands', () => {
it.each(['darwin', 'linux', 'win32', 'wsl'] as const)(
Expand Down
1 change: 0 additions & 1 deletion src/main/ipc/tui-agent-detection-commands.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { join, resolve } from 'node:path'
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
import { subscribeViaWatcherProcess, type WatcherProcessCallback } from './parcel-watcher-process'
import { subscribeViaWatcherProcess } from './parcel-watcher-process'
import type { WatcherProcessCallback } from './parcel-watcher-process-subscription'
import { startGitCommonPolling } from './worktree-git-common-polling'
import { startGitCommonNarrowWatch } from './worktree-git-common-narrow-watch'
import { createGitCommonWatchReconciliation } from './worktree-git-common-watch-reconciliation'
Expand Down
2 changes: 1 addition & 1 deletion src/main/notifications/notification-delivery-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import type {
import type { OrcaRuntimeService } from '../runtime/orca-runtime'
import { buildNotificationOptions } from '../ipc/notification-options'
import { translateMain } from '../i18n/main-i18n'
import { reserveNotificationCooldown } from '../ipc/notification-burst-cooldown'
import { reserveNotificationCooldown } from '../../shared/notification-burst-cooldown'

export type NotificationDeliveryDependencies = {
readNotificationSettings: () => NotificationSettings
Expand Down
6 changes: 2 additions & 4 deletions src/main/plugins/plugin-dev-watcher-unknown-identity.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ import { mkdir, rename, rm, stat, symlink } from 'node:fs/promises'
import type * as FsPromises from 'node:fs/promises'
import { join } from 'node:path'
import { afterEach, beforeEach, expect, it, vi } from 'vitest'
import {
subscribeViaWatcherProcess,
type WatcherProcessCallback
} from '../ipc/parcel-watcher-process'
import { subscribeViaWatcherProcess } from '../ipc/parcel-watcher-process'
import type { WatcherProcessCallback } from '../ipc/parcel-watcher-process-subscription'
import {
createAliasedWatcherRoot,
removeAliasedWatcherRoot,
Expand Down
12 changes: 6 additions & 6 deletions src/main/plugins/plugin-dev-watcher.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import type * as Fs from 'node:fs'
import { mkdir, realpath, rename, rm, stat, symlink, writeFile } from 'node:fs/promises'
import type * as FsPromises from 'node:fs/promises'
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest'
import {
subscribeViaWatcherProcess,
type WatcherProcessCallback,
type WatcherProcessHooks,
type WatcherProcessSubscribeOptions
} from '../ipc/parcel-watcher-process'
import { subscribeViaWatcherProcess } from '../ipc/parcel-watcher-process'
import type {
WatcherProcessCallback,
WatcherProcessHooks
} from '../ipc/parcel-watcher-process-subscription'
import type { WatcherProcessSubscribeOptions } from '../ipc/parcel-watcher-process-protocol'
import {
createAliasedWatcherRoot as createNativeAliasedWatcherRoot,
removeAliasedWatcherRoot,
Expand Down
8 changes: 3 additions & 5 deletions src/main/plugins/plugin-dev-watcher.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import { realpathSync, statSync, type BigIntStats } from 'node:fs'
import { realpath, stat } from 'node:fs/promises'
import { basename, dirname, resolve } from 'node:path'
import {
subscribeViaWatcherProcess,
type WatcherProcessSubscribeOptions,
type WatcherProcessSubscription
} from '../ipc/parcel-watcher-process'
import { subscribeViaWatcherProcess } from '../ipc/parcel-watcher-process'
import type { WatcherProcessSubscribeOptions } from '../ipc/parcel-watcher-process-protocol'
import type { WatcherProcessSubscription } from '../ipc/parcel-watcher-process-subscription'
import { resolveWatcherRootPaths } from '../ipc/watcher-event-root-path-rewrite'
import { watcherDirectoryIdentity } from '../ipc/watcher-directory-identity'

Expand Down
2 changes: 1 addition & 1 deletion src/main/preflight/agent-command-detection.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const { detectInstallDirs, guestMounts } = vi.hoisted(() => {
}
})

vi.mock('../ipc/local-agent-install-dir-detection', () => ({
vi.mock('../../shared/local-agent-install-dir-detection', () => ({
detectCommandsInInstallDirs: detectInstallDirs
}))
vi.mock('../ipc/preflight-command-exec', () => ({
Expand Down
Loading
Loading