Port workspaces and the durable lander into the world

This commit is contained in:
2026-11-07 15:15:53 +00:00
parent c8bf5e559e
commit fcab84012d
11 changed files with 32710 additions and 4 deletions
+12
View File
@@ -0,0 +1,12 @@
/** Durable workspace records and the landing event consumed by coordination extensions. */
import { defineDoc } from '@earendil-works/pi-durable'
import { defineEvent } from '@earendil-works/sausage-events'
export type Workspace = {source:string;target:string;path:string;branch:string;base?:string;state:'preparing'|'ready'|'failed'|'removed';preparation?:number;error?:string;landed?:string}
export type Submission = {id:string;conversationId:number;source:string;target:string;tip:string;at:number;divergence:string;title:string;conversations:string[];prepared?:{base:string;sha:string};landed?:{base:string;sha:string;commits:{sha:string;subject:string}[];paths:string[]};outcome?:any}
export const Workspaces = defineDoc<{items:Record<string,Workspace>;queue:Submission[];landers:Record<string,number>;landerConversations:Record<string,number>;results:Record<string,any>}>({
kind:'ultimate.workspaces',version:1,scope:'conversation',history:'latest',fork:'initial',checkpointWhen:()=>false,
initial:()=>({items:{},queue:[],landers:{},landerConversations:{},results:{}}),
})
export const WorkspacesApi = {name:'workspaces'}
export const SubmissionLanded = defineEvent<any>('workspaces.landed')
export const CheckRan = defineEvent<any>('workspaces.check')