fix(opencode): register account events in EventV2 bridge (#28555)
This commit is contained in:
@@ -7,6 +7,7 @@ import { InstanceRef, WorkspaceRef } from "@/effect/instance-ref"
|
|||||||
import { InstanceStore } from "@/project/instance-store"
|
import { InstanceStore } from "@/project/instance-store"
|
||||||
import { SyncEvent } from "@/sync"
|
import { SyncEvent } from "@/sync"
|
||||||
import { EventV2 } from "@opencode-ai/core/event"
|
import { EventV2 } from "@opencode-ai/core/event"
|
||||||
|
import "@opencode-ai/core/account"
|
||||||
import "@opencode-ai/core/catalog"
|
import "@opencode-ai/core/catalog"
|
||||||
import "@opencode-ai/core/session-event"
|
import "@opencode-ai/core/session-event"
|
||||||
import { Context, Effect, Layer, Option } from "effect"
|
import { Context, Effect, Layer, Option } from "effect"
|
||||||
|
|||||||
@@ -879,6 +879,9 @@ export type GlobalEvent = {
|
|||||||
| EventSessionNextCompactionEnded
|
| EventSessionNextCompactionEnded
|
||||||
| EventCatalogModelUpdated
|
| EventCatalogModelUpdated
|
||||||
| EventModelsDevRefreshed
|
| EventModelsDevRefreshed
|
||||||
|
| EventAccountAdded
|
||||||
|
| EventAccountRemoved
|
||||||
|
| EventAccountSwitched
|
||||||
| SyncEventMessageUpdated
|
| SyncEventMessageUpdated
|
||||||
| SyncEventMessageRemoved
|
| SyncEventMessageRemoved
|
||||||
| SyncEventMessagePartUpdated
|
| SyncEventMessagePartUpdated
|
||||||
@@ -3297,6 +3300,56 @@ export type EventModelsDevRefreshed = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type AccountV2oAuthCredential = {
|
||||||
|
type: "oauth"
|
||||||
|
refresh: string
|
||||||
|
access: string
|
||||||
|
expires: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export type AccountV2ApiKeyCredential = {
|
||||||
|
type: "api"
|
||||||
|
key: string
|
||||||
|
metadata?: {
|
||||||
|
[key: string]: string
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export type AccountV2Credential = AccountV2oAuthCredential | AccountV2ApiKeyCredential
|
||||||
|
|
||||||
|
export type AccountV2Info = {
|
||||||
|
id: string
|
||||||
|
serviceID: string
|
||||||
|
description: string
|
||||||
|
credential: AccountV2Credential
|
||||||
|
}
|
||||||
|
|
||||||
|
export type EventAccountAdded = {
|
||||||
|
id: string
|
||||||
|
type: "account.added"
|
||||||
|
properties: {
|
||||||
|
account: AccountV2Info
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export type EventAccountRemoved = {
|
||||||
|
id: string
|
||||||
|
type: "account.removed"
|
||||||
|
properties: {
|
||||||
|
account: AccountV2Info
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export type EventAccountSwitched = {
|
||||||
|
id: string
|
||||||
|
type: "account.switched"
|
||||||
|
properties: {
|
||||||
|
serviceID: string
|
||||||
|
from?: string
|
||||||
|
to?: string
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export type SessionInfo = {
|
export type SessionInfo = {
|
||||||
id: string
|
id: string
|
||||||
parentID?: string
|
parentID?: string
|
||||||
@@ -3708,56 +3761,6 @@ export type ModelV2Info1 = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export type AccountV2oAuthCredential = {
|
|
||||||
type: "oauth"
|
|
||||||
refresh: string
|
|
||||||
access: string
|
|
||||||
expires: number
|
|
||||||
}
|
|
||||||
|
|
||||||
export type AccountV2ApiKeyCredential = {
|
|
||||||
type: "api"
|
|
||||||
key: string
|
|
||||||
metadata?: {
|
|
||||||
[key: string]: string
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export type AccountV2Credential = AccountV2oAuthCredential | AccountV2ApiKeyCredential
|
|
||||||
|
|
||||||
export type AccountV2Info = {
|
|
||||||
id: string
|
|
||||||
serviceID: string
|
|
||||||
description: string
|
|
||||||
credential: AccountV2Credential
|
|
||||||
}
|
|
||||||
|
|
||||||
export type EventAccountAdded = {
|
|
||||||
id: string
|
|
||||||
type: "account.added"
|
|
||||||
properties: {
|
|
||||||
account: AccountV2Info
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export type EventAccountRemoved = {
|
|
||||||
id: string
|
|
||||||
type: "account.removed"
|
|
||||||
properties: {
|
|
||||||
account: AccountV2Info
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export type EventAccountSwitched = {
|
|
||||||
id: string
|
|
||||||
type: "account.switched"
|
|
||||||
properties: {
|
|
||||||
serviceID: string
|
|
||||||
from?: string
|
|
||||||
to?: string
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export type BadRequestError = {
|
export type BadRequestError = {
|
||||||
name: "BadRequest"
|
name: "BadRequest"
|
||||||
data: {
|
data: {
|
||||||
|
|||||||
Reference in New Issue
Block a user