Files
orca/src/preload/api/automation-api.ts
T
Neil 236eba1ecf fix(persistence): folder, group and session-state store writes name their host or why they needn't (R4-2c) (#30797)
* fix(persistence): session, automation-label writes take the workspace's host; exempt minted-unique folder and group ids (R4-2c)

* fix(persistence): keep the session removal's spill rule; the twin guard was unreachable (review)
2026-10-19 10:50:25 -07:00

48 lines
1.9 KiB
TypeScript

import type { ExecutionHostId } from '../../shared/execution-host'
import type {
AutomationDispatchRequest,
AutomationDispatchResult,
AutomationPrecheckResult,
AutomationRun,
ExternalAutomationManager
} from '../../shared/automations-types'
import type { AutomationOwnerRef } from '../../shared/automation-owner-ref'
import type {
ScopedExternalManagerActionRequest,
ScopedExternalManagerListRequest
} from '../../shared/external-automation-scope'
import type { AutomationsChangedPayload } from '../../shared/runtime-client-events'
export type ExternalAutomationManagerResult = {
/** Null once a probe succeeded and found no manager configured for this scope. */
manager: ExternalAutomationManager | null
error: string | null
updatedAt: number
}
/**
* Orca automation CRUD rides the local runtime RPC surface (`runtime:call`),
* so this IPC api carries only what stays desktop-native: the external-manager
* scope (probes run on this computer) and the dispatch-loop plumbing.
*/
export type AutomationsApi = {
listExternalManagerForOwner: (
request: ScopedExternalManagerListRequest
) => Promise<ExternalAutomationManagerResult>
runExternalActionForOwner: (request: ScopedExternalManagerActionRequest) => Promise<void>
retainExternalScopes: (request: { owners: readonly AutomationOwnerRef[] }) => Promise<void>
runPrecheck: (args: {
automationId: string
runId: string
}) => Promise<AutomationPrecheckResult | null>
markDispatchResult: (result: AutomationDispatchResult) => Promise<AutomationRun>
snapshotWorkspaceName: (args: {
workspaceId: string
hostId: ExecutionHostId
displayName: string
}) => Promise<number>
rendererReady: () => Promise<void>
onDispatchRequested: (callback: (request: AutomationDispatchRequest) => void) => () => void
onChanged: (callback: (payload: AutomationsChangedPayload) => void) => () => void
}