@@ -39,7 +39,7 @@ import { buildSkillWorkshopMocks } from "./control-ui-mock-skill-workshop.js";
3939
4040type CliOptions = {
4141 allowedHosts : string [ ] ;
42- fixture ?: "approval" | "board" | "swarm" ;
42+ fixture ?: "approval" | "board" | "swarm" | "workboard" ;
4343 host : string ;
4444 port : number ;
4545} ;
@@ -161,7 +161,7 @@ function parseFixture(value: string | undefined): CliOptions["fixture"] {
161161 if ( ! value ) {
162162 return undefined ;
163163 }
164- if ( value !== "approval" && value !== "board" && value !== "swarm" ) {
164+ if ( value !== "approval" && value !== "board" && value !== "swarm" && value !== "workboard" ) {
165165 throw new Error ( `Unknown Control UI mock fixture: ${ value } ` ) ;
166166 }
167167 return value ;
@@ -645,7 +645,7 @@ function buildProfileUsageMocks(baseTime: number) {
645645 * across a few real section keys, and `config.get` returns a matching
646646 * snapshot with the hash `config.set`/`config.apply` are guarded by.
647647 */
648- function buildConfigMocks ( options : { swarmEnabled ?: boolean } = { } ) {
648+ function buildConfigMocks ( options : { swarmEnabled ?: boolean ; workboardEnabled ?: boolean } = { } ) {
649649 const config = {
650650 logging : { level : "info" , consoleTimestamps : true } ,
651651 messages : { queueLimit : 5 , responsePrefix : "" } ,
@@ -654,6 +654,7 @@ function buildConfigMocks(options: { swarmEnabled?: boolean } = {}) {
654654 commands : { native : "auto" , nativeSkills : "auto" } ,
655655 models : { mode : "merge" } ,
656656 ...( options . swarmEnabled ? { tools : { swarm : true } } : { } ) ,
657+ ...( options . workboardEnabled ? { plugins : { entries : { workboard : { enabled : true } } } } : { } ) ,
657658 channels : {
658659 whatsapp : {
659660 enabled : true ,
@@ -898,6 +899,86 @@ function buildConfigMocks(options: { swarmEnabled?: boolean } = {}) {
898899 } ;
899900}
900901
902+ function buildWorkboardMocks ( baseTime : number ) {
903+ const boardId = "peter-tasks" ;
904+ const card = (
905+ id : string ,
906+ title : string ,
907+ status : string ,
908+ priority : string ,
909+ position : number ,
910+ labels : string [ ] ,
911+ ) => ( {
912+ id,
913+ title,
914+ status,
915+ priority,
916+ labels,
917+ position,
918+ createdAt : baseTime - 86_400_000 ,
919+ updatedAt : baseTime - position * 1_000 ,
920+ metadata : { automation : { boardId } } ,
921+ } ) ;
922+ const cards = [
923+ card ( "card-inbox" , "Capture customer feedback themes" , "todo" , "normal" , 1 , [ "research" ] ) ,
924+ card ( "card-brief" , "Draft weekly product brief" , "todo" , "low" , 2 , [ "writing" ] ) ,
925+ card ( "card-ready" , "Prepare launch readiness checklist" , "ready" , "high" , 1 , [ "launch" ] ) ,
926+ card ( "card-running" , "Validate onboarding flow" , "running" , "urgent" , 1 , [ "quality" ] ) ,
927+ card ( "card-review" , "Review accessibility audit" , "review" , "high" , 1 , [ "frontend" ] ) ,
928+ card ( "card-blocked" , "Confirm staging environment access" , "blocked" , "normal" , 1 , [ "ops" ] ) ,
929+ card ( "card-done" , "Publish support handoff notes" , "done" , "low" , 1 , [ "docs" ] ) ,
930+ ] ;
931+ const statuses = [ "todo" , "ready" , "running" , "review" , "blocked" , "done" ] ;
932+ const board = {
933+ id : boardId ,
934+ name : "Product Operations" ,
935+ description : "Shared product delivery queue" ,
936+ icon : "✓" ,
937+ color : "#2563eb" ,
938+ automationJobId : "job-product-operations-daily" ,
939+ total : cards . length ,
940+ active : cards . length - 1 ,
941+ archived : 0 ,
942+ byStatus : Object . fromEntries (
943+ statuses . map ( ( status ) => [ status , cards . filter ( ( entry ) => entry . status === status ) . length ] ) ,
944+ ) ,
945+ updatedAt : baseTime ,
946+ } ;
947+ const sessionKey = "agent:main:workboard-proof" ;
948+ return {
949+ board,
950+ cards,
951+ sessionKey,
952+ methodResponses : {
953+ "board.get" : {
954+ sessionKey,
955+ revision : 1 ,
956+ tabs : [ { tabId : "main" , title : "Workboard" , position : 0 , chatDock : "hidden" } ] ,
957+ widgets : [
958+ {
959+ name : "workboard-product-operations" ,
960+ tabId : "main" ,
961+ title : "Product Operations" ,
962+ contentKind : "plugin" ,
963+ pluginKind : "workboard:board" ,
964+ props : { boardId } ,
965+ heightMode : "fixed" ,
966+ sizeW : 12 ,
967+ sizeH : 16 ,
968+ position : 0 ,
969+ grantState : "none" ,
970+ revision : 1 ,
971+ } ,
972+ ] ,
973+ } ,
974+ "workboard.boards.list" : { boards : [ board ] } ,
975+ "workboard.cards.list" : { boards : [ board ] , cards, statuses } ,
976+ "workboard.cards.stats" : { ...board , byAgent : { } } ,
977+ "workboard.cards.move" : { card : cards [ 0 ] } ,
978+ } ,
979+ } ;
980+ }
981+
901982function chatHistoryMessage ( role : "assistant" | "user" , text : string , timestamp : number ) {
902983 return {
903984 content : [ { text, type : "text" } ] ,
@@ -1294,7 +1375,16 @@ async function createChatPickerScenario(
12941375 } ) ,
12951376 ]
12961377 : [ ] ;
1378+ const workboardMocks = buildWorkboardMocks ( baseTime ) ;
12971379 const sessions = [
1380+ ...( fixture === "workboard"
1381+ ? [
1382+ sessionRow ( workboardMocks . sessionKey , "Product operations dashboard" , baseTime , {
1383+ boardFace : "dashboard" ,
1384+ pinned : true ,
1385+ } ) ,
1386+ ]
1387+ : [ ] ) ,
12981388 sessionRow ( "agent:main:main" , "Molty" , baseTime - 1_000 , {
12991389 activeRunIds : [ PLAN_DEMO_RUN_ID ] ,
13001390 childSessions : [ "agent:main:lisbon-trip" , ...swarmChildRows . map ( ( row ) => row . key ) ] ,
@@ -1421,7 +1511,10 @@ async function createChatPickerScenario(
14211511 const skillWorkshop = buildSkillWorkshopMocks ( Date . now ( ) ) ;
14221512 const cronMocks = buildCronMocks ( Date . now ( ) ) ;
14231513 const channelWizard = buildChannelWizardMocks ( ) ;
1424- const configMocks = buildConfigMocks ( { swarmEnabled : fixture === "swarm" } ) ;
1514+ const configMocks = buildConfigMocks ( {
1515+ swarmEnabled : fixture === "swarm" ,
1516+ workboardEnabled : fixture === "workboard" ,
1517+ } ) ;
14251518 const custodianHistory = {
14261519 turns : [
14271520 {
@@ -1502,7 +1595,25 @@ async function createChatPickerScenario(
15021595 "sessions.create" ,
15031596 "system.info" ,
15041597 "terminal.open" ,
1598+ ...( fixture === "workboard"
1599+ ? [
1600+ "board.get" ,
1601+ "workboard.boards.list" ,
1602+ "workboard.cards.list" ,
1603+ "workboard.cards.move" ,
1604+ "workboard.cards.stats" ,
1605+ ]
1606+ : [ ] ) ,
15051607 ] ,
1608+ ...( fixture === "workboard"
1609+ ? {
1610+ controlUiWidgetKinds : [
1611+ { pluginId : "workboard" , kind : "workboard:board" , label : "Workboard board" } ,
1612+ { pluginId : "workboard" , kind : "workboard:card" , label : "Workboard card" } ,
1613+ { pluginId : "workboard" , kind : "workboard:mini" , label : "Workboard summary" } ,
1614+ ] ,
1615+ }
1616+ : { } ) ,
15061617 // Terminal has a second gate beyond the advertised method (see
15071618 // ui/src/lib/terminal-availability.ts).
15081619 terminalEnabled : true ,
@@ -2268,6 +2379,7 @@ async function createChatPickerScenario(
22682379 ...buildSessionListCases ( [ ...sessions , ...archivedSessions ] , { } , MOCK_SESSION_CREATORS ) ,
22692380 ] ,
22702381 } ,
2382+ ...( fixture === "workboard" ? workboardMocks . methodResponses : { } ) ,
22712383 } ,
22722384 models : modelProviders . models ,
22732385 repeatingSessionEvents : {
@@ -2339,7 +2451,7 @@ async function createChatPickerScenario(
23392451 hasActiveRun : true ,
23402452 key : "agent:main:main" ,
23412453 } ,
2342- sessionKey : "agent:main:main" ,
2454+ sessionKey : fixture === "workboard" ? workboardMocks . sessionKey : "agent:main:main" ,
23432455 workspace : "/Users/peter/Projects/openclaw" ,
23442456 workspaceGit : true ,
23452457 } ;
0 commit comments