feat: ship enterprise control and desktop governance

This commit is contained in:
AI Bot
2026-05-11 14:59:26 +08:00
parent 0757d07521
commit a311280238
285 changed files with 48574 additions and 2428 deletions

View File

@@ -56,7 +56,7 @@ test.after(async () => {
});
async function createAuthedRequest(url: string, method: "GET" | "POST", body?: unknown) {
return createAuthedRequestFor("17600003315", "highest_admin", url, method, body);
return createAuthedRequestFor("krisolo", "highest_admin", url, method, body);
}
async function createAuthedRequestFor(
@@ -90,7 +90,7 @@ test("device import draft review queues only the resolution task, then completio
await createAuthedRequest("http://127.0.0.1:3000/api/v1/devices/enrollments", "POST", {
name: "MacBook Pro",
avatar: "P",
account: "17600003315",
account: "krisolo",
endpoint: "mac://mbp.local",
note: "待导入新设备",
}),
@@ -110,7 +110,7 @@ test("device import draft review queues only the resolution task, then completio
pairingCode: enrollmentPayload.enrollment.pairingCode,
name: "MacBook Pro",
avatar: "P",
account: "17600003315",
account: "krisolo",
status: "online",
quota5h: 72,
quota7d: 88,
@@ -317,7 +317,7 @@ test("device import draft review queues only the resolution task, then completio
pairingCode: enrollmentPayload.enrollment.pairingCode,
name: "Mac mini",
avatar: "M",
account: "17600003315",
account: "krisolo",
status: "online",
quota5h: 73,
quota7d: 84,
@@ -364,7 +364,7 @@ test("imported thread projects append progress events on newer activity without
await createAuthedRequest("http://127.0.0.1:3000/api/v1/devices/enrollments", "POST", {
name: "Mac mini",
avatar: "M",
account: "17600003315",
account: "krisolo",
endpoint: "mac://mini.local",
note: "project sync follow-up",
}),
@@ -380,7 +380,7 @@ test("imported thread projects append progress events on newer activity without
pairingCode: enrollmentPayload.enrollment.pairingCode,
name: "Mac mini",
avatar: "M",
account: "17600003315",
account: "krisolo",
status: "online" as const,
quota5h: 73,
quota7d: 84,
@@ -580,7 +580,7 @@ test("heartbeat candidates no longer auto-create chat windows from legacy projec
await createAuthedRequest("http://127.0.0.1:3000/api/v1/devices/enrollments", "POST", {
name: "ThinkPad",
avatar: "T",
account: "17600003315",
account: "krisolo",
endpoint: "pc://thinkpad.local",
note: "legacy projects should not auto import",
}),
@@ -603,7 +603,7 @@ test("heartbeat candidates no longer auto-create chat windows from legacy projec
pairingCode: enrollmentPayload.enrollment.pairingCode,
name: "ThinkPad",
avatar: "T",
account: "17600003315",
account: "krisolo",
status: "online",
quota5h: 60,
quota7d: 75,
@@ -641,7 +641,7 @@ test("device import apply is idempotent and heartbeat preserves applied status",
await createAuthedRequest("http://127.0.0.1:3000/api/v1/devices/enrollments", "POST", {
name: "Studio Mac",
avatar: "S",
account: "17600003315",
account: "krisolo",
endpoint: "mac://studio.local",
note: "idempotent import apply",
}),
@@ -657,7 +657,7 @@ test("device import apply is idempotent and heartbeat preserves applied status",
pairingCode: enrollmentPayload.enrollment.pairingCode,
name: "Studio Mac",
avatar: "S",
account: "17600003315",
account: "krisolo",
status: "online" as const,
quota5h: 68,
quota7d: 82,
@@ -801,7 +801,7 @@ test("clearing device import selection resets draft back to pending_selection an
await createAuthedRequest("http://127.0.0.1:3000/api/v1/devices/enrollments", "POST", {
name: "Review Mac",
avatar: "R",
account: "17600003315",
account: "krisolo",
endpoint: "mac://review.local",
note: "selection reset",
}),
@@ -823,7 +823,7 @@ test("clearing device import selection resets draft back to pending_selection an
pairingCode: enrollmentPayload.enrollment.pairingCode,
name: "Review Mac",
avatar: "R",
account: "17600003315",
account: "krisolo",
status: "online",
quota5h: 66,
quota7d: 79,
@@ -913,7 +913,7 @@ test("device import routes reject unrelated logged-in members", async () => {
await createAuthedRequest("http://127.0.0.1:3000/api/v1/devices/enrollments", "POST", {
name: "Build Mac",
avatar: "B",
account: "17600003315",
account: "krisolo",
endpoint: "mac://build.local",
note: "route auth test",
}),
@@ -935,7 +935,7 @@ test("device import routes reject unrelated logged-in members", async () => {
pairingCode: enrollmentPayload.enrollment.pairingCode,
name: "Build Mac",
avatar: "B",
account: "17600003315",
account: "krisolo",
status: "online",
quota5h: 71,
quota7d: 80,
@@ -984,7 +984,7 @@ test("existing bound production devices auto-sync suggested candidates into conv
token: "boss-mac-studio-token",
name: "Mac Studio",
avatar: "M",
account: "17600003315",
account: "krisolo",
status: "online",
quota5h: 68,
quota7d: 81,
@@ -1047,7 +1047,7 @@ test("existing bound production devices auto-sync suggested candidates into conv
token: "boss-mac-studio-token",
name: "Mac Studio",
avatar: "M",
account: "17600003315",
account: "krisolo",
status: "online",
quota5h: 68,
quota7d: 81,