revert unrelated bus type tightening from command PR
parent
d1f7df0b97
commit
68409c9471
|
|
@ -1,5 +1,5 @@
|
|||
import z from "zod"
|
||||
import type { ZodObject, ZodRawShape } from "zod"
|
||||
import type { ZodType } from "zod"
|
||||
import { Log } from "../util/log"
|
||||
|
||||
export namespace BusEvent {
|
||||
|
|
@ -9,7 +9,7 @@ export namespace BusEvent {
|
|||
|
||||
const registry = new Map<string, Definition>()
|
||||
|
||||
export function define<Type extends string, Properties extends ZodObject<ZodRawShape>>(type: Type, properties: Properties) {
|
||||
export function define<Type extends string, Properties extends ZodType>(type: Type, properties: Properties) {
|
||||
const result = {
|
||||
type,
|
||||
properties,
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ export const GlobalBus = new EventEmitter<{
|
|||
event: [
|
||||
{
|
||||
directory?: string
|
||||
payload: { type: string; properties: Record<string, unknown> }
|
||||
payload: any
|
||||
},
|
||||
]
|
||||
}>()
|
||||
|
|
|
|||
|
|
@ -124,7 +124,7 @@ export namespace Workspace {
|
|||
await parseSSE(res.body, stop, (event) => {
|
||||
GlobalBus.emit("event", {
|
||||
directory: space.id,
|
||||
payload: event as { type: string; properties: Record<string, unknown> },
|
||||
payload: event,
|
||||
})
|
||||
})
|
||||
// Wait 250ms and retry if SSE connection fails
|
||||
|
|
|
|||
Loading…
Reference in New Issue