吸收数字员工治理动作入口
This commit is contained in:
@@ -440,6 +440,41 @@ describe("digital employee state service", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("records plan action governance commands as local run facts", async () => {
|
||||
const { recordDigitalEmployeeGovernanceCommand } = await import("./stateService");
|
||||
|
||||
recordDigitalEmployeeGovernanceCommand({
|
||||
commandKind: "pause_plan",
|
||||
commandId: "command-pause-plan",
|
||||
planId: "plan-action",
|
||||
accepted: true,
|
||||
message: "暂停计划执行",
|
||||
payload: { plan_id: "plan-action", requested_action: "plan_pause" },
|
||||
result: { plan_id: "plan-action", status: "paused" },
|
||||
});
|
||||
|
||||
expect(mockState.db?.plans.get("plan-action")).toMatchObject({
|
||||
status: "paused",
|
||||
sync_status: "pending",
|
||||
});
|
||||
expect(mockState.db?.tasks.get("governance-task-command-pause-plan")).toMatchObject({
|
||||
plan_id: "plan-action",
|
||||
status: "paused",
|
||||
assigned_skill_id: "qimingclaw-governance-command",
|
||||
});
|
||||
expect(mockState.db?.runs.get("governance-run-command-pause-plan")).toMatchObject({
|
||||
plan_id: "plan-action",
|
||||
status: "paused",
|
||||
finished_at: "2026-06-07T08:00:00.000Z",
|
||||
});
|
||||
expect(mockState.db?.events.get("governance-run-command-pause-plan:pause_plan:command-pause-plan")).toMatchObject({
|
||||
kind: "governance_pause_plan",
|
||||
message: "暂停计划执行",
|
||||
});
|
||||
expect(mockState.db?.outbox.get("plan:upsert:plan-action")).toMatchObject({ entity_type: "plan" });
|
||||
expect(mockState.db?.outbox.get("event:insert:governance-run-command-pause-plan:pause_plan:command-pause-plan")).toMatchObject({ entity_type: "event" });
|
||||
});
|
||||
|
||||
it("records schedule lifecycle commands and manual runs", async () => {
|
||||
const {
|
||||
readDigitalEmployeeRuntimeRecords,
|
||||
|
||||
Reference in New Issue
Block a user