fix(opencode): restore global sync event compatibility

This commit is contained in:
Dax Raad 2026-06-03 19:52:49 -04:00
commit 5e3026b5ce
9 changed files with 766 additions and 303 deletions

View file

@ -255,6 +255,10 @@ import type {
TuiShowToastResponses,
TuiSubmitPromptErrors,
TuiSubmitPromptResponses,
V2CommandListErrors,
V2CommandListResponses,
V2EventSubscribeErrors,
V2EventSubscribeResponses,
V2FsListErrors,
V2FsListResponses,
V2FsReadErrors,
@ -287,6 +291,8 @@ import type {
V2SessionPromptResponses,
V2SessionWaitErrors,
V2SessionWaitResponses,
V2SkillListErrors,
V2SkillListResponses,
VcsApplyErrors,
VcsApplyResponses,
VcsDiffErrors,
@ -4990,6 +4996,78 @@ export class Fs extends HeyApiClient {
}
}
export class Command2 extends HeyApiClient {
/**
* List v2 commands
*
* Retrieve currently registered v2 commands.
*/
public list<ThrowOnError extends boolean = false>(
parameters?: {
location?: {
directory?: string
workspace?: string
}
},
options?: Options<never, ThrowOnError>,
) {
const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "location" }] }])
return (options?.client ?? this.client).get<V2CommandListResponses, V2CommandListErrors, ThrowOnError>({
url: "/api/command",
...options,
...params,
})
}
}
export class Skill extends HeyApiClient {
/**
* List v2 skills
*
* Retrieve currently registered v2 skills.
*/
public list<ThrowOnError extends boolean = false>(
parameters?: {
location?: {
directory?: string
workspace?: string
}
},
options?: Options<never, ThrowOnError>,
) {
const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "location" }] }])
return (options?.client ?? this.client).get<V2SkillListResponses, V2SkillListErrors, ThrowOnError>({
url: "/api/skill",
...options,
...params,
})
}
}
export class Event2 extends HeyApiClient {
/**
* Subscribe to v2 events
*
* Subscribe to native EventV2 payloads for a location.
*/
public subscribe<ThrowOnError extends boolean = false>(
parameters?: {
location?: {
directory?: string
workspace?: string
}
},
options?: Options<never, ThrowOnError>,
) {
const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "location" }] }])
return (options?.client ?? this.client).sse.get<V2EventSubscribeResponses, V2EventSubscribeErrors, ThrowOnError>({
url: "/api/event",
...options,
...params,
})
}
}
export class V2 extends HeyApiClient {
private _session?: Session3
get session(): Session3 {
@ -5015,6 +5093,21 @@ export class V2 extends HeyApiClient {
get fs(): Fs {
return (this._fs ??= new Fs({ client: this.client }))
}
private _command?: Command2
get command(): Command2 {
return (this._command ??= new Command2({ client: this.client }))
}
private _skill?: Skill
get skill(): Skill {
return (this._skill ??= new Skill({ client: this.client }))
}
private _event?: Event2
get event(): Event2 {
return (this._event ??= new Event2({ client: this.client }))
}
}
export class Control extends HeyApiClient {

File diff suppressed because it is too large Load diff