Skip to content

Commit e6301ca

Browse files
committed
tweak: rename event
1 parent b562863 commit e6301ca

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

packages/opencode/src/session/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ export namespace Session {
7878
export type ShareInfo = z.output<typeof ShareInfo>
7979

8080
export const Event = {
81-
Started: Bus.event(
82-
"session.started",
81+
Created: Bus.event(
82+
"session.created",
8383
z.object({
8484
info: Info,
8585
}),
@@ -173,7 +173,7 @@ export namespace Session {
173173
}
174174
log.info("created", result)
175175
await Storage.write(["session", Instance.project.id, result.id], result)
176-
Bus.publish(Event.Started, {
176+
Bus.publish(Event.Created, {
177177
info: result,
178178
})
179179
const cfg = await Config.get()

packages/opencode/test/session/session.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ describe("session.started event", () => {
1616
let eventReceived = false
1717
let receivedInfo: Session.Info | undefined
1818

19-
const unsub = Bus.subscribe(Session.Event.Started, (event) => {
19+
const unsub = Bus.subscribe(Session.Event.Created, (event) => {
2020
eventReceived = true
2121
receivedInfo = event.properties.info as Session.Info
2222
})
@@ -45,7 +45,7 @@ describe("session.started event", () => {
4545
fn: async () => {
4646
const events: string[] = []
4747

48-
const unsubStarted = Bus.subscribe(Session.Event.Started, () => {
48+
const unsubStarted = Bus.subscribe(Session.Event.Created, () => {
4949
events.push("started")
5050
})
5151

0 commit comments

Comments
 (0)