Skip to content

Commit aed0307

Browse files
chore: generate
1 parent c50d65b commit aed0307

3 files changed

Lines changed: 18 additions & 39 deletions

File tree

packages/opencode/src/bus/index.ts

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,7 @@ type State = {
3333
}
3434

3535
export interface Interface {
36-
readonly publish: <D extends BusEvent.Definition>(
37-
def: D,
38-
properties: BusProperties<D>,
39-
) => Effect.Effect<void>
36+
readonly publish: <D extends BusEvent.Definition>(def: D, properties: BusProperties<D>) => Effect.Effect<void>
4037
readonly subscribe: <D extends BusEvent.Definition>(def: D) => Stream.Stream<Payload<D>>
4138
readonly subscribeAll: () => Stream.Stream<Payload>
4239
readonly subscribeCallback: <D extends BusEvent.Definition>(
@@ -85,10 +82,7 @@ export const layer = Layer.effect(
8582
})
8683
}
8784

88-
function publish<D extends BusEvent.Definition>(
89-
def: D,
90-
properties: BusProperties<D>,
91-
) {
85+
function publish<D extends BusEvent.Definition>(def: D, properties: BusProperties<D>) {
9286
return Effect.gen(function* () {
9387
const s = yield* InstanceState.get(state)
9488
const payload: Payload = { type: def.type, properties }
@@ -184,17 +178,11 @@ const { runPromise, runSync } = makeRuntime(Service, layer)
184178

185179
// runSync is safe here because the subscribe chain (InstanceState.get, PubSub.subscribe,
186180
// Scope.make, Effect.forkScoped) is entirely synchronous. If any step becomes async, this will throw.
187-
export async function publish<D extends BusEvent.Definition>(
188-
def: D,
189-
properties: BusProperties<D>,
190-
) {
181+
export async function publish<D extends BusEvent.Definition>(def: D, properties: BusProperties<D>) {
191182
return runPromise((svc) => svc.publish(def, properties))
192183
}
193184

194-
export function subscribe<D extends BusEvent.Definition>(
195-
def: D,
196-
callback: (event: Payload<D>) => unknown,
197-
) {
185+
export function subscribe<D extends BusEvent.Definition>(def: D, callback: (event: Payload<D>) => unknown) {
198186
return runSync((svc) => svc.subscribeCallback(def, callback))
199187
}
200188

packages/opencode/src/sync/index.ts

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@ import { Schema as EffectSchema, Types } from "effect"
1212
import { zodObject } from "@/util/effect-zod"
1313
import { isRecord } from "@/util/record"
1414

15-
export type Definition<Schema extends EffectSchema.Top = EffectSchema.Top, BusSchema extends EffectSchema.Top = Schema> = {
15+
export type Definition<
16+
Schema extends EffectSchema.Top = EffectSchema.Top,
17+
BusSchema extends EffectSchema.Top = Schema,
18+
> = {
1619
type: string
1720
version: number
1821
aggregate: string
@@ -87,10 +90,13 @@ export function define<
8790
Agg extends string,
8891
Schema extends EffectSchema.Top,
8992
BusSchema extends EffectSchema.Top = Schema,
90-
>(input: { type: Type; version: number; aggregate: Agg; schema: Schema; busSchema?: BusSchema }): Definition<
91-
Schema,
92-
BusSchema
93-
> {
93+
>(input: {
94+
type: Type
95+
version: number
96+
aggregate: Agg
97+
schema: Schema
98+
busSchema?: BusSchema
99+
}): Definition<Schema, BusSchema> {
94100
if (frozen) {
95101
throw new Error("Error defining sync event: sync system has been frozen")
96102
}

packages/sdk/openapi.json

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10570,8 +10570,7 @@
1057010570
}
1057110571
]
1057210572
}
10573-
},
10574-
"required": ["url"]
10573+
}
1057510574
},
1057610575
"title": {
1057710576
"anyOf": [
@@ -10636,8 +10635,7 @@
1063610635
}
1063710636
]
1063810637
}
10639-
},
10640-
"required": ["created", "updated", "compacting", "archived"]
10638+
}
1064110639
},
1064210640
"permission": {
1064310641
"anyOf": [
@@ -10676,20 +10674,7 @@
1067610674
}
1067710675
]
1067810676
}
10679-
},
10680-
"required": [
10681-
"id",
10682-
"slug",
10683-
"projectID",
10684-
"workspaceID",
10685-
"directory",
10686-
"parentID",
10687-
"summary",
10688-
"title",
10689-
"version",
10690-
"permission",
10691-
"revert"
10692-
]
10677+
}
1069310678
}
1069410679
},
1069510680
"required": ["sessionID", "info"]

0 commit comments

Comments
 (0)