Port workspaces and the durable lander into the world
This commit is contained in:
@@ -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')
|
||||
Reference in New Issue
Block a user