chore: generate

This commit is contained in:
opencode-agent[bot]
2026-05-02 23:34:40 +00:00
parent f98053c34e
commit 9bef88e3b0
5 changed files with 315 additions and 315 deletions
@@ -16,22 +16,22 @@ export const emitGlobalDisposed = Effect.sync(() =>
}), }),
) )
export const disposeAllInstancesAndEmitGlobalDisposed = Effect.fn( export const disposeAllInstancesAndEmitGlobalDisposed = Effect.fn("Server.disposeAllInstancesAndEmitGlobalDisposed")(
"Server.disposeAllInstancesAndEmitGlobalDisposed", function* (options?: { swallowErrors?: boolean }) {
)(function* (options?: { swallowErrors?: boolean }) { const store = yield* InstanceStore.Service
const store = yield* InstanceStore.Service yield* Effect.gen(function* () {
yield* Effect.gen(function* () { yield* options?.swallowErrors
yield* (options?.swallowErrors ? store.disposeAll().pipe(
? store.disposeAll().pipe( Effect.catchCause((cause) =>
Effect.catchCause((cause) => Effect.sync(() => {
Effect.sync(() => { log.warn("global disposal failed", { cause })
log.warn("global disposal failed", { cause }) }),
}), ),
), )
) : store.disposeAll()
: store.disposeAll()) yield* emitGlobalDisposed
yield* emitGlobalDisposed }).pipe(Effect.uninterruptible)
}).pipe(Effect.uninterruptible) },
}) )
export * as GlobalLifecycle from "./global-lifecycle" export * as GlobalLifecycle from "./global-lifecycle"
+6 -2
View File
@@ -155,7 +155,9 @@ export const provideInstance =
Effect.contextWith((services: Context.Context<R>) => Effect.contextWith((services: Context.Context<R>) =>
Effect.promise<A>(async () => { Effect.promise<A>(async () => {
const ctx = await runTestInstanceStore((store) => store.load({ directory })) const ctx = await runTestInstanceStore((store) => store.load({ directory }))
return Instance.restore(ctx, () => Effect.runPromiseWith(services)(self.pipe(Effect.provideService(InstanceRef, ctx)))) return Instance.restore(ctx, () =>
Effect.runPromiseWith(services)(self.pipe(Effect.provideService(InstanceRef, ctx))),
)
}), }),
) )
@@ -170,7 +172,9 @@ export function provideTmpdirInstance<A, E, R>(
yield* Effect.addFinalizer(() => yield* Effect.addFinalizer(() =>
provided provided
? Effect.promise(() => ? Effect.promise(() =>
runTestInstanceStore((store) => store.load({ directory: path }).pipe(Effect.flatMap((ctx) => store.dispose(ctx)))), runTestInstanceStore((store) =>
store.load({ directory: path }).pipe(Effect.flatMap((ctx) => store.dispose(ctx))),
),
).pipe(Effect.ignore) ).pipe(Effect.ignore)
: Effect.void, : Effect.void,
) )
@@ -17,11 +17,7 @@ const ROOT = path.resolve(import.meta.dir, "..", "..")
const it = testEffect(Layer.mergeAll(Truncate.defaultLayer, NodeFileSystem.layer)) const it = testEffect(Layer.mergeAll(Truncate.defaultLayer, NodeFileSystem.layer))
const configuredLayer = (cfg: Config.Info) => const configuredLayer = (cfg: Config.Info) =>
Layer.mergeAll( Layer.mergeAll(Truncate.defaultLayer, NodeFileSystem.layer, TestConfig.layer({ get: () => Effect.succeed(cfg) }))
Truncate.defaultLayer,
NodeFileSystem.layer,
TestConfig.layer({ get: () => Effect.succeed(cfg) }),
)
const configuredIt = (cfg: Config.Info) => testEffect(configuredLayer(cfg)) const configuredIt = (cfg: Config.Info) => testEffect(configuredLayer(cfg))
describe("Truncate", () => { describe("Truncate", () => {
+77 -77
View File
@@ -40,35 +40,6 @@ export type EventServerInstanceDisposed = {
} }
} }
export type EventServerConnected = {
type: "server.connected"
properties: {
[key: string]: unknown
}
}
export type EventGlobalDisposed = {
type: "global.disposed"
properties: {
[key: string]: unknown
}
}
export type EventFileEdited = {
type: "file.edited"
properties: {
file: string
}
}
export type EventFileWatcherUpdated = {
type: "file.watcher.updated"
properties: {
file: string
event: "add" | "change" | "unlink"
}
}
export type EventLspClientDiagnostics = { export type EventLspClientDiagnostics = {
type: "lsp.client.diagnostics" type: "lsp.client.diagnostics"
properties: { properties: {
@@ -230,6 +201,53 @@ export type EventInstallationUpdateAvailable = {
} }
} }
export type EventWorkspaceReady = {
type: "workspace.ready"
properties: {
name: string
}
}
export type EventWorkspaceFailed = {
type: "workspace.failed"
properties: {
message: string
}
}
export type EventWorkspaceRestore = {
type: "workspace.restore"
properties: {
workspaceID: string
sessionID: string
total: number
step: number
}
}
export type EventWorkspaceStatus = {
type: "workspace.status"
properties: {
workspaceID: string
status: "connected" | "connecting" | "disconnected" | "error"
}
}
export type EventFileEdited = {
type: "file.edited"
properties: {
file: string
}
}
export type EventFileWatcherUpdated = {
type: "file.watcher.updated"
properties: {
file: string
event: "add" | "change" | "unlink"
}
}
export type QuestionOption = { export type QuestionOption = {
/** /**
* Display text (1-5 words, concise) * Display text (1-5 words, concise)
@@ -452,38 +470,6 @@ export type EventVcsBranchUpdated = {
} }
} }
export type EventWorkspaceReady = {
type: "workspace.ready"
properties: {
name: string
}
}
export type EventWorkspaceFailed = {
type: "workspace.failed"
properties: {
message: string
}
}
export type EventWorkspaceRestore = {
type: "workspace.restore"
properties: {
workspaceID: string
sessionID: string
total: number
step: number
}
}
export type EventWorkspaceStatus = {
type: "workspace.status"
properties: {
workspaceID: string
status: "connected" | "connecting" | "disconnected" | "error"
}
}
export type EventWorktreeReady = { export type EventWorktreeReady = {
type: "worktree.ready" type: "worktree.ready"
properties: { properties: {
@@ -988,6 +974,20 @@ export type EventSessionDeleted = {
} }
} }
export type EventServerConnected = {
type: "server.connected"
properties: {
[key: string]: unknown
}
}
export type EventGlobalDisposed = {
type: "global.disposed"
properties: {
[key: string]: unknown
}
}
export type SyncEventMessageUpdated = { export type SyncEventMessageUpdated = {
type: "sync" type: "sync"
name: "message.updated.1" name: "message.updated.1"
@@ -1113,10 +1113,6 @@ export type GlobalEvent = {
payload: payload:
| EventProjectUpdated | EventProjectUpdated
| EventServerInstanceDisposed | EventServerInstanceDisposed
| EventServerConnected
| EventGlobalDisposed
| EventFileEdited
| EventFileWatcherUpdated
| EventLspClientDiagnostics | EventLspClientDiagnostics
| EventLspUpdated | EventLspUpdated
| EventMessagePartDelta | EventMessagePartDelta
@@ -1126,6 +1122,12 @@ export type GlobalEvent = {
| EventSessionError | EventSessionError
| EventInstallationUpdated | EventInstallationUpdated
| EventInstallationUpdateAvailable | EventInstallationUpdateAvailable
| EventWorkspaceReady
| EventWorkspaceFailed
| EventWorkspaceRestore
| EventWorkspaceStatus
| EventFileEdited
| EventFileWatcherUpdated
| EventQuestionAsked | EventQuestionAsked
| EventQuestionReplied | EventQuestionReplied
| EventQuestionRejected | EventQuestionRejected
@@ -1141,10 +1143,6 @@ export type GlobalEvent = {
| EventMcpBrowserOpenFailed | EventMcpBrowserOpenFailed
| EventCommandExecuted | EventCommandExecuted
| EventVcsBranchUpdated | EventVcsBranchUpdated
| EventWorkspaceReady
| EventWorkspaceFailed
| EventWorkspaceRestore
| EventWorkspaceStatus
| EventWorktreeReady | EventWorktreeReady
| EventWorktreeFailed | EventWorktreeFailed
| EventPtyCreated | EventPtyCreated
@@ -1158,6 +1156,8 @@ export type GlobalEvent = {
| EventSessionCreated | EventSessionCreated
| EventSessionUpdated | EventSessionUpdated
| EventSessionDeleted | EventSessionDeleted
| EventServerConnected
| EventGlobalDisposed
| SyncEventMessageUpdated | SyncEventMessageUpdated
| SyncEventMessageRemoved | SyncEventMessageRemoved
| SyncEventMessagePartUpdated | SyncEventMessagePartUpdated
@@ -2056,10 +2056,6 @@ export type File = {
export type Event = export type Event =
| EventProjectUpdated | EventProjectUpdated
| EventServerInstanceDisposed | EventServerInstanceDisposed
| EventServerConnected
| EventGlobalDisposed
| EventFileEdited
| EventFileWatcherUpdated
| EventLspClientDiagnostics | EventLspClientDiagnostics
| EventLspUpdated | EventLspUpdated
| EventMessagePartDelta | EventMessagePartDelta
@@ -2069,6 +2065,12 @@ export type Event =
| EventSessionError | EventSessionError
| EventInstallationUpdated | EventInstallationUpdated
| EventInstallationUpdateAvailable | EventInstallationUpdateAvailable
| EventWorkspaceReady
| EventWorkspaceFailed
| EventWorkspaceRestore
| EventWorkspaceStatus
| EventFileEdited
| EventFileWatcherUpdated
| EventQuestionAsked | EventQuestionAsked
| EventQuestionReplied | EventQuestionReplied
| EventQuestionRejected | EventQuestionRejected
@@ -2084,10 +2086,6 @@ export type Event =
| EventMcpBrowserOpenFailed | EventMcpBrowserOpenFailed
| EventCommandExecuted | EventCommandExecuted
| EventVcsBranchUpdated | EventVcsBranchUpdated
| EventWorkspaceReady
| EventWorkspaceFailed
| EventWorkspaceRestore
| EventWorkspaceStatus
| EventWorktreeReady | EventWorktreeReady
| EventWorktreeFailed | EventWorktreeFailed
| EventPtyCreated | EventPtyCreated
@@ -2101,6 +2099,8 @@ export type Event =
| EventSessionCreated | EventSessionCreated
| EventSessionUpdated | EventSessionUpdated
| EventSessionDeleted | EventSessionDeleted
| EventServerConnected
| EventGlobalDisposed
export type McpStatusConnected = { export type McpStatusConnected = {
status: "connected" status: "connected"
+214 -214
View File
@@ -7693,76 +7693,6 @@
}, },
"required": ["type", "properties"] "required": ["type", "properties"]
}, },
"Event.server.connected": {
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "server.connected"
},
"properties": {
"type": "object",
"properties": {}
}
},
"required": ["type", "properties"]
},
"Event.global.disposed": {
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "global.disposed"
},
"properties": {
"type": "object",
"properties": {}
}
},
"required": ["type", "properties"]
},
"Event.file.edited": {
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "file.edited"
},
"properties": {
"type": "object",
"properties": {
"file": {
"type": "string"
}
},
"required": ["file"]
}
},
"required": ["type", "properties"]
},
"Event.file.watcher.updated": {
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "file.watcher.updated"
},
"properties": {
"type": "object",
"properties": {
"file": {
"type": "string"
},
"event": {
"type": "string",
"enum": ["add", "change", "unlink"]
}
},
"required": ["file", "event"]
}
},
"required": ["type", "properties"]
},
"Event.lsp.client.diagnostics": { "Event.lsp.client.diagnostics": {
"type": "object", "type": "object",
"properties": { "properties": {
@@ -8225,6 +8155,144 @@
}, },
"required": ["type", "properties"] "required": ["type", "properties"]
}, },
"Event.workspace.ready": {
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "workspace.ready"
},
"properties": {
"type": "object",
"properties": {
"name": {
"type": "string"
}
},
"required": ["name"]
}
},
"required": ["type", "properties"]
},
"Event.workspace.failed": {
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "workspace.failed"
},
"properties": {
"type": "object",
"properties": {
"message": {
"type": "string"
}
},
"required": ["message"]
}
},
"required": ["type", "properties"]
},
"Event.workspace.restore": {
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "workspace.restore"
},
"properties": {
"type": "object",
"properties": {
"workspaceID": {
"type": "string",
"pattern": "^wrk.*"
},
"sessionID": {
"type": "string",
"pattern": "^ses.*"
},
"total": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"step": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
},
"required": ["workspaceID", "sessionID", "total", "step"]
}
},
"required": ["type", "properties"]
},
"Event.workspace.status": {
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "workspace.status"
},
"properties": {
"type": "object",
"properties": {
"workspaceID": {
"type": "string",
"pattern": "^wrk.*"
},
"status": {
"type": "string",
"enum": ["connected", "connecting", "disconnected", "error"]
}
},
"required": ["workspaceID", "status"]
}
},
"required": ["type", "properties"]
},
"Event.file.edited": {
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "file.edited"
},
"properties": {
"type": "object",
"properties": {
"file": {
"type": "string"
}
},
"required": ["file"]
}
},
"required": ["type", "properties"]
},
"Event.file.watcher.updated": {
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "file.watcher.updated"
},
"properties": {
"type": "object",
"properties": {
"file": {
"type": "string"
},
"event": {
"type": "string",
"enum": ["add", "change", "unlink"]
}
},
"required": ["file", "event"]
}
},
"required": ["type", "properties"]
},
"QuestionOption": { "QuestionOption": {
"type": "object", "type": "object",
"properties": { "properties": {
@@ -8743,102 +8811,6 @@
}, },
"required": ["type", "properties"] "required": ["type", "properties"]
}, },
"Event.workspace.ready": {
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "workspace.ready"
},
"properties": {
"type": "object",
"properties": {
"name": {
"type": "string"
}
},
"required": ["name"]
}
},
"required": ["type", "properties"]
},
"Event.workspace.failed": {
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "workspace.failed"
},
"properties": {
"type": "object",
"properties": {
"message": {
"type": "string"
}
},
"required": ["message"]
}
},
"required": ["type", "properties"]
},
"Event.workspace.restore": {
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "workspace.restore"
},
"properties": {
"type": "object",
"properties": {
"workspaceID": {
"type": "string",
"pattern": "^wrk.*"
},
"sessionID": {
"type": "string",
"pattern": "^ses.*"
},
"total": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
},
"step": {
"type": "integer",
"minimum": 0,
"maximum": 9007199254740991
}
},
"required": ["workspaceID", "sessionID", "total", "step"]
}
},
"required": ["type", "properties"]
},
"Event.workspace.status": {
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "workspace.status"
},
"properties": {
"type": "object",
"properties": {
"workspaceID": {
"type": "string",
"pattern": "^wrk.*"
},
"status": {
"type": "string",
"enum": ["connected", "connecting", "disconnected", "error"]
}
},
"required": ["workspaceID", "status"]
}
},
"required": ["type", "properties"]
},
"Event.worktree.ready": { "Event.worktree.ready": {
"type": "object", "type": "object",
"properties": { "properties": {
@@ -10441,6 +10413,34 @@
}, },
"required": ["type", "properties"] "required": ["type", "properties"]
}, },
"Event.server.connected": {
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "server.connected"
},
"properties": {
"type": "object",
"properties": {}
}
},
"required": ["type", "properties"]
},
"Event.global.disposed": {
"type": "object",
"properties": {
"type": {
"type": "string",
"const": "global.disposed"
},
"properties": {
"type": "object",
"properties": {}
}
},
"required": ["type", "properties"]
},
"SyncEvent.message.updated": { "SyncEvent.message.updated": {
"type": "object", "type": "object",
"properties": { "properties": {
@@ -10963,18 +10963,6 @@
{ {
"$ref": "#/components/schemas/Event.server.instance.disposed" "$ref": "#/components/schemas/Event.server.instance.disposed"
}, },
{
"$ref": "#/components/schemas/Event.server.connected"
},
{
"$ref": "#/components/schemas/Event.global.disposed"
},
{
"$ref": "#/components/schemas/Event.file.edited"
},
{
"$ref": "#/components/schemas/Event.file.watcher.updated"
},
{ {
"$ref": "#/components/schemas/Event.lsp.client.diagnostics" "$ref": "#/components/schemas/Event.lsp.client.diagnostics"
}, },
@@ -11002,6 +10990,24 @@
{ {
"$ref": "#/components/schemas/Event.installation.update-available" "$ref": "#/components/schemas/Event.installation.update-available"
}, },
{
"$ref": "#/components/schemas/Event.workspace.ready"
},
{
"$ref": "#/components/schemas/Event.workspace.failed"
},
{
"$ref": "#/components/schemas/Event.workspace.restore"
},
{
"$ref": "#/components/schemas/Event.workspace.status"
},
{
"$ref": "#/components/schemas/Event.file.edited"
},
{
"$ref": "#/components/schemas/Event.file.watcher.updated"
},
{ {
"$ref": "#/components/schemas/Event.question.asked" "$ref": "#/components/schemas/Event.question.asked"
}, },
@@ -11047,18 +11053,6 @@
{ {
"$ref": "#/components/schemas/Event.vcs.branch.updated" "$ref": "#/components/schemas/Event.vcs.branch.updated"
}, },
{
"$ref": "#/components/schemas/Event.workspace.ready"
},
{
"$ref": "#/components/schemas/Event.workspace.failed"
},
{
"$ref": "#/components/schemas/Event.workspace.restore"
},
{
"$ref": "#/components/schemas/Event.workspace.status"
},
{ {
"$ref": "#/components/schemas/Event.worktree.ready" "$ref": "#/components/schemas/Event.worktree.ready"
}, },
@@ -11098,6 +11092,12 @@
{ {
"$ref": "#/components/schemas/Event.session.deleted" "$ref": "#/components/schemas/Event.session.deleted"
}, },
{
"$ref": "#/components/schemas/Event.server.connected"
},
{
"$ref": "#/components/schemas/Event.global.disposed"
},
{ {
"$ref": "#/components/schemas/SyncEvent.message.updated" "$ref": "#/components/schemas/SyncEvent.message.updated"
}, },
@@ -13256,18 +13256,6 @@
{ {
"$ref": "#/components/schemas/Event.server.instance.disposed" "$ref": "#/components/schemas/Event.server.instance.disposed"
}, },
{
"$ref": "#/components/schemas/Event.server.connected"
},
{
"$ref": "#/components/schemas/Event.global.disposed"
},
{
"$ref": "#/components/schemas/Event.file.edited"
},
{
"$ref": "#/components/schemas/Event.file.watcher.updated"
},
{ {
"$ref": "#/components/schemas/Event.lsp.client.diagnostics" "$ref": "#/components/schemas/Event.lsp.client.diagnostics"
}, },
@@ -13295,6 +13283,24 @@
{ {
"$ref": "#/components/schemas/Event.installation.update-available" "$ref": "#/components/schemas/Event.installation.update-available"
}, },
{
"$ref": "#/components/schemas/Event.workspace.ready"
},
{
"$ref": "#/components/schemas/Event.workspace.failed"
},
{
"$ref": "#/components/schemas/Event.workspace.restore"
},
{
"$ref": "#/components/schemas/Event.workspace.status"
},
{
"$ref": "#/components/schemas/Event.file.edited"
},
{
"$ref": "#/components/schemas/Event.file.watcher.updated"
},
{ {
"$ref": "#/components/schemas/Event.question.asked" "$ref": "#/components/schemas/Event.question.asked"
}, },
@@ -13340,18 +13346,6 @@
{ {
"$ref": "#/components/schemas/Event.vcs.branch.updated" "$ref": "#/components/schemas/Event.vcs.branch.updated"
}, },
{
"$ref": "#/components/schemas/Event.workspace.ready"
},
{
"$ref": "#/components/schemas/Event.workspace.failed"
},
{
"$ref": "#/components/schemas/Event.workspace.restore"
},
{
"$ref": "#/components/schemas/Event.workspace.status"
},
{ {
"$ref": "#/components/schemas/Event.worktree.ready" "$ref": "#/components/schemas/Event.worktree.ready"
}, },
@@ -13390,6 +13384,12 @@
}, },
{ {
"$ref": "#/components/schemas/Event.session.deleted" "$ref": "#/components/schemas/Event.session.deleted"
},
{
"$ref": "#/components/schemas/Event.server.connected"
},
{
"$ref": "#/components/schemas/Event.global.disposed"
} }
] ]
}, },