|
@@ -87,6 +87,8 @@ export class WorkspaceRuntime extends WorkspaceScheduler {
|
|
|
}
|
|
}
|
|
|
desktopEnvironments?:DesktopEnvironments
|
|
desktopEnvironments?:DesktopEnvironments
|
|
|
cloud?:GrokCloud
|
|
cloud?:GrokCloud
|
|
|
|
|
+ /** Wired to the runner hub: false degrades envs VM turns to profile sessions. */
|
|
|
|
|
+ computerAvailable?:(owner:string,agent:Agent)=>boolean
|
|
|
inspector?:import('./workspaceInspector.js').WorkspaceInspector
|
|
inspector?:import('./workspaceInspector.js').WorkspaceInspector
|
|
|
private live = new Map<string, LiveTurn>()
|
|
private live = new Map<string, LiveTurn>()
|
|
|
readonly teamTools: WorkspaceTeamTools
|
|
readonly teamTools: WorkspaceTeamTools
|
|
@@ -271,7 +273,8 @@ export class WorkspaceRuntime extends WorkspaceScheduler {
|
|
|
this.nodes.requireSource(owner, agent)
|
|
this.nodes.requireSource(owner, agent)
|
|
|
if (agent.remoteAgentId) agent = await this.nodes.refreshRemoteAgent(owner,agent)
|
|
if (agent.remoteAgentId) agent = await this.nodes.refreshRemoteAgent(owner,agent)
|
|
|
const key = this.bindingKey(c.id, run.conversationTaskId, agent.id),
|
|
const key = this.bindingKey(c.id, run.conversationTaskId, agent.id),
|
|
|
- target = agent.remoteAgentId || agent.execution==='computer' ? this.nodes.targetForAgent(owner,agent) : this.nodes.target(owner, agent.nodeId)
|
|
|
|
|
|
|
+ computerExecution = !!(agent.remoteAgentId || (agent.execution==='computer' && (!agent.envs || this.computerAvailable?.(owner,agent) !== false))),
|
|
|
|
|
+ target = computerExecution ? this.nodes.targetForAgent(owner,agent) : this.nodes.target(owner, agent.nodeId)
|
|
|
const gateway = new WorkspaceGateway(target,{workId:run.id,publishArtifact:async(name,bytes)=>{
|
|
const gateway = new WorkspaceGateway(target,{workId:run.id,publishArtifact:async(name,bytes)=>{
|
|
|
this.requireAuthorization(owner,run.runId);this.nodes.requireSource(owner,agent)
|
|
this.requireAuthorization(owner,run.runId);this.nodes.requireSource(owner,agent)
|
|
|
const file=this.publishArtifact(owner,resultMessage,agent,name,bytes)
|
|
const file=this.publishArtifact(owner,resultMessage,agent,name,bytes)
|
|
@@ -317,7 +320,7 @@ export class WorkspaceRuntime extends WorkspaceScheduler {
|
|
|
conversationTaskId: run.conversationTaskId,
|
|
conversationTaskId: run.conversationTaskId,
|
|
|
seq: 0,
|
|
seq: 0,
|
|
|
role: 'assistant',
|
|
role: 'assistant',
|
|
|
- execution:agent.execution??'profile',
|
|
|
|
|
|
|
+ execution:computerExecution?'computer':(agent.execution??'profile'),
|
|
|
agentId: agent.id,
|
|
agentId: agent.id,
|
|
|
agentName: agent.name,
|
|
agentName: agent.name,
|
|
|
content: '',
|
|
content: '',
|
|
@@ -623,8 +626,8 @@ export class WorkspaceRuntime extends WorkspaceScheduler {
|
|
|
binding = {
|
|
binding = {
|
|
|
memoryVersion: recovering ? binding?.memoryVersion : memory.version,
|
|
memoryVersion: recovering ? binding?.memoryVersion : memory.version,
|
|
|
runnerId: target.runner?.id,
|
|
runnerId: target.runner?.id,
|
|
|
- execution:agent.execution,
|
|
|
|
|
- vmExecution:agent.vmExecution,
|
|
|
|
|
|
|
+ execution:computerExecution?'computer':'profile',
|
|
|
|
|
+ vmExecution:computerExecution?agent.vmExecution:undefined,
|
|
|
hermesComputer:target.runner?.hermesComputer,
|
|
hermesComputer:target.runner?.hermesComputer,
|
|
|
computerEnvironmentId:agent.computerEnvironmentId,
|
|
computerEnvironmentId:agent.computerEnvironmentId,
|
|
|
id: key,
|
|
id: key,
|