Skip to content

Commit becf57e

Browse files
chore: generate
1 parent f33aec1 commit becf57e

4 files changed

Lines changed: 247 additions & 251 deletions

File tree

packages/opencode/src/project/instance-store.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,10 +178,7 @@ export const layer: Layer.Layer<Service, never, Project.Service> = Layer.effect(
178178
return yield* cachedDisposeAll
179179
})
180180

181-
const provide = <A, E, R, R2>(
182-
input: LoadInput<R2>,
183-
effect: Effect.Effect<A, E, R>,
184-
): Effect.Effect<A, E, R | R2> =>
181+
const provide = <A, E, R, R2>(input: LoadInput<R2>, effect: Effect.Effect<A, E, R>): Effect.Effect<A, E, R | R2> =>
185182
load(input).pipe(Effect.flatMap((ctx) => effect.pipe(Effect.provideService(InstanceRef, ctx))))
186183

187184
yield* Effect.addFinalizer(() => disposeAll().pipe(Effect.ignore))

packages/opencode/src/project/instance.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,8 @@ export const Instance = {
3535
return InstanceStore.runtime.runPromise((store) => store.load(liftLegacyInput(input)))
3636
},
3737
async provide<R>(input: { directory: string; init?: () => Promise<unknown>; fn: () => R }): Promise<R> {
38-
return context.provide(
39-
await Instance.load({ directory: input.directory, init: input.init }),
40-
async () => input.fn(),
38+
return context.provide(await Instance.load({ directory: input.directory, init: input.init }), async () =>
39+
input.fn(),
4140
)
4241
},
4342
get current() {

packages/sdk/js/src/v2/gen/types.gen.ts

Lines changed: 64 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,6 @@ export type EventProjectUpdated = {
3333
properties: Project
3434
}
3535

36-
export type EventServerInstanceDisposed = {
37-
type: "server.instance.disposed"
38-
properties: {
39-
directory: string
40-
}
41-
}
42-
4336
export type EventServerConnected = {
4437
type: "server.connected"
4538
properties: {
@@ -54,18 +47,10 @@ export type EventGlobalDisposed = {
5447
}
5548
}
5649

57-
export type EventFileEdited = {
58-
type: "file.edited"
59-
properties: {
60-
file: string
61-
}
62-
}
63-
64-
export type EventFileWatcherUpdated = {
65-
type: "file.watcher.updated"
50+
export type EventServerInstanceDisposed = {
51+
type: "server.instance.disposed"
6652
properties: {
67-
file: string
68-
event: "add" | "change" | "unlink"
53+
directory: string
6954
}
7055
}
7156

@@ -230,6 +215,53 @@ export type EventInstallationUpdateAvailable = {
230215
}
231216
}
232217

218+
export type EventWorkspaceReady = {
219+
type: "workspace.ready"
220+
properties: {
221+
name: string
222+
}
223+
}
224+
225+
export type EventWorkspaceFailed = {
226+
type: "workspace.failed"
227+
properties: {
228+
message: string
229+
}
230+
}
231+
232+
export type EventWorkspaceRestore = {
233+
type: "workspace.restore"
234+
properties: {
235+
workspaceID: string
236+
sessionID: string
237+
total: number
238+
step: number
239+
}
240+
}
241+
242+
export type EventWorkspaceStatus = {
243+
type: "workspace.status"
244+
properties: {
245+
workspaceID: string
246+
status: "connected" | "connecting" | "disconnected" | "error"
247+
}
248+
}
249+
250+
export type EventFileEdited = {
251+
type: "file.edited"
252+
properties: {
253+
file: string
254+
}
255+
}
256+
257+
export type EventFileWatcherUpdated = {
258+
type: "file.watcher.updated"
259+
properties: {
260+
file: string
261+
event: "add" | "change" | "unlink"
262+
}
263+
}
264+
233265
export type QuestionOption = {
234266
/**
235267
* Display text (1-5 words, concise)
@@ -452,38 +484,6 @@ export type EventVcsBranchUpdated = {
452484
}
453485
}
454486

455-
export type EventWorkspaceReady = {
456-
type: "workspace.ready"
457-
properties: {
458-
name: string
459-
}
460-
}
461-
462-
export type EventWorkspaceFailed = {
463-
type: "workspace.failed"
464-
properties: {
465-
message: string
466-
}
467-
}
468-
469-
export type EventWorkspaceRestore = {
470-
type: "workspace.restore"
471-
properties: {
472-
workspaceID: string
473-
sessionID: string
474-
total: number
475-
step: number
476-
}
477-
}
478-
479-
export type EventWorkspaceStatus = {
480-
type: "workspace.status"
481-
properties: {
482-
workspaceID: string
483-
status: "connected" | "connecting" | "disconnected" | "error"
484-
}
485-
}
486-
487487
export type EventWorktreeReady = {
488488
type: "worktree.ready"
489489
properties: {
@@ -1112,11 +1112,9 @@ export type GlobalEvent = {
11121112
workspace?: string
11131113
payload:
11141114
| EventProjectUpdated
1115-
| EventServerInstanceDisposed
11161115
| EventServerConnected
11171116
| EventGlobalDisposed
1118-
| EventFileEdited
1119-
| EventFileWatcherUpdated
1117+
| EventServerInstanceDisposed
11201118
| EventLspClientDiagnostics
11211119
| EventLspUpdated
11221120
| EventMessagePartDelta
@@ -1126,6 +1124,12 @@ export type GlobalEvent = {
11261124
| EventSessionError
11271125
| EventInstallationUpdated
11281126
| EventInstallationUpdateAvailable
1127+
| EventWorkspaceReady
1128+
| EventWorkspaceFailed
1129+
| EventWorkspaceRestore
1130+
| EventWorkspaceStatus
1131+
| EventFileEdited
1132+
| EventFileWatcherUpdated
11291133
| EventQuestionAsked
11301134
| EventQuestionReplied
11311135
| EventQuestionRejected
@@ -1141,10 +1145,6 @@ export type GlobalEvent = {
11411145
| EventMcpBrowserOpenFailed
11421146
| EventCommandExecuted
11431147
| EventVcsBranchUpdated
1144-
| EventWorkspaceReady
1145-
| EventWorkspaceFailed
1146-
| EventWorkspaceRestore
1147-
| EventWorkspaceStatus
11481148
| EventWorktreeReady
11491149
| EventWorktreeFailed
11501150
| EventPtyCreated
@@ -2055,11 +2055,9 @@ export type File = {
20552055

20562056
export type Event =
20572057
| EventProjectUpdated
2058-
| EventServerInstanceDisposed
20592058
| EventServerConnected
20602059
| EventGlobalDisposed
2061-
| EventFileEdited
2062-
| EventFileWatcherUpdated
2060+
| EventServerInstanceDisposed
20632061
| EventLspClientDiagnostics
20642062
| EventLspUpdated
20652063
| EventMessagePartDelta
@@ -2069,6 +2067,12 @@ export type Event =
20692067
| EventSessionError
20702068
| EventInstallationUpdated
20712069
| EventInstallationUpdateAvailable
2070+
| EventWorkspaceReady
2071+
| EventWorkspaceFailed
2072+
| EventWorkspaceRestore
2073+
| EventWorkspaceStatus
2074+
| EventFileEdited
2075+
| EventFileWatcherUpdated
20722076
| EventQuestionAsked
20732077
| EventQuestionReplied
20742078
| EventQuestionRejected
@@ -2084,10 +2088,6 @@ export type Event =
20842088
| EventMcpBrowserOpenFailed
20852089
| EventCommandExecuted
20862090
| EventVcsBranchUpdated
2087-
| EventWorkspaceReady
2088-
| EventWorkspaceFailed
2089-
| EventWorkspaceRestore
2090-
| EventWorkspaceStatus
20912091
| EventWorktreeReady
20922092
| EventWorktreeFailed
20932093
| EventPtyCreated

0 commit comments

Comments
 (0)