|
|
@@ -19,7 +19,7 @@ import type {
|
|
|
WorkspaceAgentUsageSummary,
|
|
|
} from '../shared/workspace.js'
|
|
|
import { personaSection } from '../shared/workspace.js'
|
|
|
-import { readHostTools } from './hostToolSettings.js'
|
|
|
+import { deniedHostToolsets, readHostTools } from './hostToolSettings.js'
|
|
|
function globalComputers(home: string) {
|
|
|
try { return readHostTools(home) }
|
|
|
catch { return { denyServerTools: true, scriptMachine: false, serverComputer: false, vm: false, cloud: false } }
|
|
|
@@ -785,6 +785,7 @@ export class WorkspaceRuntime extends WorkspaceScheduler {
|
|
|
const goal = run.conversationTaskId ? this.store.get<import('../shared/agentTasks.js').AgentGoal>(owner, 'goal', run.conversationTaskId) : undefined
|
|
|
const assignmentId = this.store.require<Run>(owner, 'run', run.runId).assignmentId
|
|
|
const globals = globalComputers(this.store.home)
|
|
|
+ const deniedToolsets = deniedHostToolsets(this.store.home)
|
|
|
const eligible = !agent.remoteAgentId && !agent.temporaryGoalId && !agent.archived
|
|
|
const open = [eligible && (globals.scriptMachine || globals.serverComputer) ? '脚本机' : '', eligible && globals.vm && agent.envs ? '虚拟环境' : '', eligible && globals.cloud ? '云虚拟机' : ''].filter(Boolean)
|
|
|
const envDirective = `同一条对话里,只使用 Bot 设置里全局开放的环境:${open.join('、') || '无'}。脚本机里,本机是夭夭正在运行的这台电脑,省略 host 或写「本机」就看它,其他脚本机按名称点名。虚拟环境是服务端上的隔离虚拟机,云虚拟机是 Grok Bot 虚拟机。没开放的不要用。${deniedToolsets.length ? '服务端本机的终端和文件已全局禁用,不要用服务端本机顶上。' : '全局设置已允许使用服务端本机的终端和文件。'}`
|