mirror of
https://github.com/stablyai/orca.git
synced 2026-11-02 18:17:36 +00:00
feat(acp): hosts install a managed runtime over RPC, and mark agents whose program Orca provides (#29024)
* feat(acp): hosts install a managed runtime over RPC, and mark agents whose program Orca provides
managedRuntime.status / managedRuntime.install / managedRuntime.cancel, negotiated by
managed-runtime.install.v1, act on the host that receives them, the one that runs the agent's
chats, with no workspace needed. A status read naming the revision it shows is a long-poll on its
own call-queue lane, so every client sees another's start, progress and outcome.
agentSession.agents marks an agent whose program Orca provides on that host.
* fix(runtime): install status says a copy outside Orca's runs only when a start would really run it
* fix(runtime): install status is pushed to subscribers instead of long-polled, and Cancel answers with the outcome
managedRuntime.subscribe {agent} sends a full snapshot on subscribe, then one
snapshot per install state change, and closes with the transport. It replaces
the managedRuntime.status long-poll and its slot registrations.
This commit is contained in:
@@ -18,6 +18,9 @@ export const AGENT_SESSION_AGENTS_METHOD = 'agentSession.agents'
|
||||
export type AgentSessionRegisteredAgent = {
|
||||
agent: string
|
||||
capabilities: AgentSessionCapabilities
|
||||
/** Orca provides this chat's program on this host, so it needs no installed CLI. Absent from
|
||||
* older hosts, whose chats are offered only where the agent's CLI was detected. */
|
||||
managedRuntime?: true
|
||||
}
|
||||
|
||||
export type AgentSessionAgentsResult = {
|
||||
@@ -46,7 +49,9 @@ const registeredAgentSchema = z.object({
|
||||
approvalEnforcement: openEnum(['provider', 'orca'] as const, 'orca')
|
||||
.optional()
|
||||
.default('orca')
|
||||
})
|
||||
}),
|
||||
// A false from a host reads as absent, so the row keeps the detection-based offer.
|
||||
managedRuntime: z.literal(true).optional().catch(undefined)
|
||||
})
|
||||
|
||||
/** The host's agents as this build reads them, or null when the reply is not an agent list. */
|
||||
|
||||
@@ -36,6 +36,7 @@ export const HOST_OPERATION_OWNERSHIP = {
|
||||
jira: 'scope-picked',
|
||||
layout: 'host',
|
||||
linear: 'scope-picked',
|
||||
managedRuntime: 'host',
|
||||
managedServer: 'host',
|
||||
markdown: 'host',
|
||||
mobileRelay: 'host',
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
// A runtime Orca installs for an agent only when the person asks, as its host reports it.
|
||||
|
||||
// The host answers managedRuntime.subscribe, managedRuntime.install and managedRuntime.cancel.
|
||||
export const MANAGED_RUNTIME_INSTALL_RUNTIME_CAPABILITY = 'managed-runtime.install.v1' as const
|
||||
|
||||
export type ManagedRuntimeOperation = {
|
||||
id: string
|
||||
kind: 'install' | 'remove'
|
||||
|
||||
@@ -62,6 +62,7 @@ export * from './agent-session-resume-runtime-capabilities'
|
||||
import { AGENT_SESSION_BACKGROUND_TASK_CHILD_VIEWS_CAPABILITY } from './agent-session-background-task-child-views-capability'
|
||||
import { AGENT_SESSION_STOP_RUNTIME_CAPABILITIES } from './agent-session-stop-capabilities'
|
||||
import { AGENT_SESSION_CREATE_RUNTIME_CAPABILITIES } from './agent-session-create-capabilities'
|
||||
import { MANAGED_RUNTIME_INSTALL_RUNTIME_CAPABILITY } from './managed-runtime-install'
|
||||
import { REMOTE_SERVER_UPDATE_CAPABILITY } from './remote-server-update'
|
||||
import { MOBILE_RELAY_RUNTIME_CAPABILITIES } from './mobile-desktop-relay-contract'
|
||||
import { SKILL_RUNTIME_CAPABILITIES } from './skill-install-capability'
|
||||
@@ -229,6 +230,7 @@ export const RUNTIME_CAPABILITIES = [
|
||||
...SESSION_TABS_RUNTIME_CAPABILITIES,
|
||||
AGENT_SESSION_BOUNDARY_RUNTIME_CAPABILITY,
|
||||
REMOTE_SERVER_UPDATE_CAPABILITY,
|
||||
MANAGED_RUNTIME_INSTALL_RUNTIME_CAPABILITY,
|
||||
AGENT_SESSION_HOST_AUTHORITY_RUNTIME_CAPABILITY,
|
||||
AGENT_SESSION_OMP_RESUME_PATH_RUNTIME_CAPABILITY,
|
||||
AGENT_SESSION_KEYBOARD_RUNTIME_CAPABILITY,
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
import { z } from 'zod'
|
||||
import { StructuredAgent } from './structured-agent-session-params'
|
||||
|
||||
export const ManagedRuntimeAgentParams = z.strictObject({ agent: StructuredAgent })
|
||||
|
||||
export const ManagedRuntimeCancelParams = z.strictObject({
|
||||
agent: StructuredAgent,
|
||||
operationId: z.string().min(1).max(64)
|
||||
})
|
||||
@@ -381,6 +381,10 @@ import {
|
||||
WorkspaceSelection
|
||||
} from './linear-params'
|
||||
import { CreateProject } from './linear-project-create-params'
|
||||
import {
|
||||
ManagedRuntimeAgentParams,
|
||||
ManagedRuntimeCancelParams
|
||||
} from './managed-runtime-install-params'
|
||||
import {
|
||||
ManagedServerRecover,
|
||||
ManagedServerSelector,
|
||||
@@ -1083,6 +1087,9 @@ export const RPC_PARAMS_BY_METHOD = {
|
||||
'linear.teamStates': TeamId,
|
||||
'linear.testConnection': WorkspaceSelection,
|
||||
'linear.updateIssue': IssueUpdateOfLinearParams,
|
||||
'managedRuntime.cancel': ManagedRuntimeCancelParams,
|
||||
'managedRuntime.install': ManagedRuntimeAgentParams,
|
||||
'managedRuntime.subscribe': ManagedRuntimeAgentParams,
|
||||
'managedServer.cancelStop': ManagedServerSelector,
|
||||
'managedServer.forget': ManagedServerSelector,
|
||||
'managedServer.recover': ManagedServerRecover,
|
||||
|
||||
Reference in New Issue
Block a user