Skip to content

Commit 9bef88e

Browse files
chore: generate
1 parent f98053c commit 9bef88e

5 files changed

Lines changed: 315 additions & 315 deletions

File tree

packages/opencode/src/server/global-lifecycle.ts

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,22 @@ export const emitGlobalDisposed = Effect.sync(() =>
1616
}),
1717
)
1818

19-
export const disposeAllInstancesAndEmitGlobalDisposed = Effect.fn(
20-
"Server.disposeAllInstancesAndEmitGlobalDisposed",
21-
)(function* (options?: { swallowErrors?: boolean }) {
22-
const store = yield* InstanceStore.Service
23-
yield* Effect.gen(function* () {
24-
yield* (options?.swallowErrors
25-
? store.disposeAll().pipe(
26-
Effect.catchCause((cause) =>
27-
Effect.sync(() => {
28-
log.warn("global disposal failed", { cause })
29-
}),
30-
),
31-
)
32-
: store.disposeAll())
33-
yield* emitGlobalDisposed
34-
}).pipe(Effect.uninterruptible)
35-
})
19+
export const disposeAllInstancesAndEmitGlobalDisposed = Effect.fn("Server.disposeAllInstancesAndEmitGlobalDisposed")(
20+
function* (options?: { swallowErrors?: boolean }) {
21+
const store = yield* InstanceStore.Service
22+
yield* Effect.gen(function* () {
23+
yield* options?.swallowErrors
24+
? store.disposeAll().pipe(
25+
Effect.catchCause((cause) =>
26+
Effect.sync(() => {
27+
log.warn("global disposal failed", { cause })
28+
}),
29+
),
30+
)
31+
: store.disposeAll()
32+
yield* emitGlobalDisposed
33+
}).pipe(Effect.uninterruptible)
34+
},
35+
)
3636

3737
export * as GlobalLifecycle from "./global-lifecycle"

packages/opencode/test/fixture/fixture.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,9 @@ export const provideInstance =
155155
Effect.contextWith((services: Context.Context<R>) =>
156156
Effect.promise<A>(async () => {
157157
const ctx = await runTestInstanceStore((store) => store.load({ directory }))
158-
return Instance.restore(ctx, () => Effect.runPromiseWith(services)(self.pipe(Effect.provideService(InstanceRef, ctx))))
158+
return Instance.restore(ctx, () =>
159+
Effect.runPromiseWith(services)(self.pipe(Effect.provideService(InstanceRef, ctx))),
160+
)
159161
}),
160162
)
161163

@@ -170,7 +172,9 @@ export function provideTmpdirInstance<A, E, R>(
170172
yield* Effect.addFinalizer(() =>
171173
provided
172174
? Effect.promise(() =>
173-
runTestInstanceStore((store) => store.load({ directory: path }).pipe(Effect.flatMap((ctx) => store.dispose(ctx)))),
175+
runTestInstanceStore((store) =>
176+
store.load({ directory: path }).pipe(Effect.flatMap((ctx) => store.dispose(ctx))),
177+
),
174178
).pipe(Effect.ignore)
175179
: Effect.void,
176180
)

packages/opencode/test/tool/truncation.test.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,7 @@ const ROOT = path.resolve(import.meta.dir, "..", "..")
1717
const it = testEffect(Layer.mergeAll(Truncate.defaultLayer, NodeFileSystem.layer))
1818

1919
const configuredLayer = (cfg: Config.Info) =>
20-
Layer.mergeAll(
21-
Truncate.defaultLayer,
22-
NodeFileSystem.layer,
23-
TestConfig.layer({ get: () => Effect.succeed(cfg) }),
24-
)
20+
Layer.mergeAll(Truncate.defaultLayer, NodeFileSystem.layer, TestConfig.layer({ get: () => Effect.succeed(cfg) }))
2521
const configuredIt = (cfg: Config.Info) => testEffect(configuredLayer(cfg))
2622

2723
describe("Truncate", () => {

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

Lines changed: 77 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -40,35 +40,6 @@ export type EventServerInstanceDisposed = {
4040
}
4141
}
4242

43-
export type EventServerConnected = {
44-
type: "server.connected"
45-
properties: {
46-
[key: string]: unknown
47-
}
48-
}
49-
50-
export type EventGlobalDisposed = {
51-
type: "global.disposed"
52-
properties: {
53-
[key: string]: unknown
54-
}
55-
}
56-
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"
66-
properties: {
67-
file: string
68-
event: "add" | "change" | "unlink"
69-
}
70-
}
71-
7243
export type EventLspClientDiagnostics = {
7344
type: "lsp.client.diagnostics"
7445
properties: {
@@ -230,6 +201,53 @@ export type EventInstallationUpdateAvailable = {
230201
}
231202
}
232203

204+
export type EventWorkspaceReady = {
205+
type: "workspace.ready"
206+
properties: {
207+
name: string
208+
}
209+
}
210+
211+
export type EventWorkspaceFailed = {
212+
type: "workspace.failed"
213+
properties: {
214+
message: string
215+
}
216+
}
217+
218+
export type EventWorkspaceRestore = {
219+
type: "workspace.restore"
220+
properties: {
221+
workspaceID: string
222+
sessionID: string
223+
total: number
224+
step: number
225+
}
226+
}
227+
228+
export type EventWorkspaceStatus = {
229+
type: "workspace.status"
230+
properties: {
231+
workspaceID: string
232+
status: "connected" | "connecting" | "disconnected" | "error"
233+
}
234+
}
235+
236+
export type EventFileEdited = {
237+
type: "file.edited"
238+
properties: {
239+
file: string
240+
}
241+
}
242+
243+
export type EventFileWatcherUpdated = {
244+
type: "file.watcher.updated"
245+
properties: {
246+
file: string
247+
event: "add" | "change" | "unlink"
248+
}
249+
}
250+
233251
export type QuestionOption = {
234252
/**
235253
* Display text (1-5 words, concise)
@@ -452,38 +470,6 @@ export type EventVcsBranchUpdated = {
452470
}
453471
}
454472

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-
487473
export type EventWorktreeReady = {
488474
type: "worktree.ready"
489475
properties: {
@@ -988,6 +974,20 @@ export type EventSessionDeleted = {
988974
}
989975
}
990976

977+
export type EventServerConnected = {
978+
type: "server.connected"
979+
properties: {
980+
[key: string]: unknown
981+
}
982+
}
983+
984+
export type EventGlobalDisposed = {
985+
type: "global.disposed"
986+
properties: {
987+
[key: string]: unknown
988+
}
989+
}
990+
991991
export type SyncEventMessageUpdated = {
992992
type: "sync"
993993
name: "message.updated.1"
@@ -1113,10 +1113,6 @@ export type GlobalEvent = {
11131113
payload:
11141114
| EventProjectUpdated
11151115
| EventServerInstanceDisposed
1116-
| EventServerConnected
1117-
| EventGlobalDisposed
1118-
| EventFileEdited
1119-
| EventFileWatcherUpdated
11201116
| EventLspClientDiagnostics
11211117
| EventLspUpdated
11221118
| EventMessagePartDelta
@@ -1126,6 +1122,12 @@ export type GlobalEvent = {
11261122
| EventSessionError
11271123
| EventInstallationUpdated
11281124
| EventInstallationUpdateAvailable
1125+
| EventWorkspaceReady
1126+
| EventWorkspaceFailed
1127+
| EventWorkspaceRestore
1128+
| EventWorkspaceStatus
1129+
| EventFileEdited
1130+
| EventFileWatcherUpdated
11291131
| EventQuestionAsked
11301132
| EventQuestionReplied
11311133
| EventQuestionRejected
@@ -1141,10 +1143,6 @@ export type GlobalEvent = {
11411143
| EventMcpBrowserOpenFailed
11421144
| EventCommandExecuted
11431145
| EventVcsBranchUpdated
1144-
| EventWorkspaceReady
1145-
| EventWorkspaceFailed
1146-
| EventWorkspaceRestore
1147-
| EventWorkspaceStatus
11481146
| EventWorktreeReady
11491147
| EventWorktreeFailed
11501148
| EventPtyCreated
@@ -1158,6 +1156,8 @@ export type GlobalEvent = {
11581156
| EventSessionCreated
11591157
| EventSessionUpdated
11601158
| EventSessionDeleted
1159+
| EventServerConnected
1160+
| EventGlobalDisposed
11611161
| SyncEventMessageUpdated
11621162
| SyncEventMessageRemoved
11631163
| SyncEventMessagePartUpdated
@@ -2056,10 +2056,6 @@ export type File = {
20562056
export type Event =
20572057
| EventProjectUpdated
20582058
| EventServerInstanceDisposed
2059-
| EventServerConnected
2060-
| EventGlobalDisposed
2061-
| EventFileEdited
2062-
| EventFileWatcherUpdated
20632059
| EventLspClientDiagnostics
20642060
| EventLspUpdated
20652061
| EventMessagePartDelta
@@ -2069,6 +2065,12 @@ export type Event =
20692065
| EventSessionError
20702066
| EventInstallationUpdated
20712067
| EventInstallationUpdateAvailable
2068+
| EventWorkspaceReady
2069+
| EventWorkspaceFailed
2070+
| EventWorkspaceRestore
2071+
| EventWorkspaceStatus
2072+
| EventFileEdited
2073+
| EventFileWatcherUpdated
20722074
| EventQuestionAsked
20732075
| EventQuestionReplied
20742076
| EventQuestionRejected
@@ -2084,10 +2086,6 @@ export type Event =
20842086
| EventMcpBrowserOpenFailed
20852087
| EventCommandExecuted
20862088
| EventVcsBranchUpdated
2087-
| EventWorkspaceReady
2088-
| EventWorkspaceFailed
2089-
| EventWorkspaceRestore
2090-
| EventWorkspaceStatus
20912089
| EventWorktreeReady
20922090
| EventWorktreeFailed
20932091
| EventPtyCreated
@@ -2101,6 +2099,8 @@ export type Event =
21012099
| EventSessionCreated
21022100
| EventSessionUpdated
21032101
| EventSessionDeleted
2102+
| EventServerConnected
2103+
| EventGlobalDisposed
21042104

21052105
export type McpStatusConnected = {
21062106
status: "connected"

0 commit comments

Comments
 (0)