feat: ship enterprise control and desktop governance
This commit is contained in:
51
tests/computer-control-task-model.test.ts
Normal file
51
tests/computer-control-task-model.test.ts
Normal file
@@ -0,0 +1,51 @@
|
||||
import assert from "node:assert/strict";
|
||||
import test from "node:test";
|
||||
import type { ExecutionRequestKind } from "@/lib/execution/types";
|
||||
import type { ExecutionToolName } from "@/lib/execution/tool-registry";
|
||||
import type { MasterAgentTask } from "@/lib/boss-data";
|
||||
|
||||
test("execution request kinds support browser and desktop control", () => {
|
||||
const browserKind: ExecutionRequestKind = "browser_control";
|
||||
const desktopKind: ExecutionRequestKind = "desktop_control";
|
||||
|
||||
assert.equal(browserKind, "browser_control");
|
||||
assert.equal(desktopKind, "desktop_control");
|
||||
});
|
||||
|
||||
test("execution tool names support browser and desktop control", () => {
|
||||
const browserTool: ExecutionToolName = "browser_control";
|
||||
const desktopTool: ExecutionToolName = "desktop_control";
|
||||
|
||||
assert.equal(browserTool, "browser_control");
|
||||
assert.equal(desktopTool, "desktop_control");
|
||||
});
|
||||
|
||||
test("master agent task supports computer control metadata", () => {
|
||||
const task: MasterAgentTask = {
|
||||
taskId: "task-browser-control",
|
||||
projectId: "master-agent",
|
||||
taskType: "browser_control",
|
||||
requestMessageId: "msg-1",
|
||||
requestText: "打开后台首页",
|
||||
executionPrompt: "请打开后台首页并检查顶部导航。",
|
||||
requestedBy: "Boss 超级管理员",
|
||||
requestedByAccount: "krisolo",
|
||||
deviceId: "mac-studio",
|
||||
status: "queued",
|
||||
requestedAt: "2026-04-22T10:00:00.000Z",
|
||||
intentCategory: "browser_control",
|
||||
runtimeKind: "browser-automation-runtime",
|
||||
riskLevel: "medium",
|
||||
confirmationPolicy: "light_confirm",
|
||||
requiresUserConfirmation: true,
|
||||
confirmationScopeKey: "mac-studio:boss",
|
||||
};
|
||||
|
||||
assert.equal(task.taskType, "browser_control");
|
||||
assert.equal(task.intentCategory, "browser_control");
|
||||
assert.equal(task.runtimeKind, "browser-automation-runtime");
|
||||
assert.equal(task.riskLevel, "medium");
|
||||
assert.equal(task.confirmationPolicy, "light_confirm");
|
||||
assert.equal(task.requiresUserConfirmation, true);
|
||||
assert.equal(task.confirmationScopeKey, "mac-studio:boss");
|
||||
});
|
||||
Reference in New Issue
Block a user