refactor(api): remove watermark sync surface

This commit is contained in:
Dax Raad 2026-07-06 12:59:26 -04:00
commit ff499c3603
25 changed files with 141 additions and 392 deletions

View file

@ -278,8 +278,6 @@ import type {
V2CredentialUpdateResponses,
V2DebugLocationErrors,
V2DebugLocationResponses,
V2EventChangesErrors,
V2EventChangesResponses,
V2EventSubscribeErrors,
V2EventSubscribeResponses,
V2FormRequestListErrors,
@ -334,6 +332,8 @@ import type {
V2ProjectCurrentResponses,
V2ProjectDirectoriesErrors,
V2ProjectDirectoriesResponses,
V2ProjectListErrors,
V2ProjectListResponses,
V2ProviderGetErrors,
V2ProviderGetResponses,
V2ProviderListErrors,
@ -5896,7 +5896,7 @@ export class Session3 extends HeyApiClient {
/**
* List active sessions
*
* Retrieve foreground Session drains currently owned by this OpenCode process. Sessions absent from the result are inactive. Watermarks are the durable log positions read alongside the activity snapshot; activity itself is process state, so the pairing is advisory rather than transactional.
* Retrieve foreground Session drains currently owned by this OpenCode process. Sessions absent from the result are inactive.
*/
public active<ThrowOnError extends boolean = false>(options?: Options<never, ThrowOnError>) {
return (options?.client ?? this.client).get<V2SessionActiveResponses, V2SessionActiveErrors, ThrowOnError>({
@ -6341,7 +6341,7 @@ export class Session3 extends HeyApiClient {
/**
* Read the session log
*
* Durable, ordered, gap-free read of public session events after an exclusive aggregate sequence. Emits a synced marker once replay reaches the captured watermark, then completes; with follow=true it continues with live events instead. The only event API that promises reliability: attach after a snapshot watermark to compose fetch and stream without a race window.
* Experimental durable session event log. Reads events after an exclusive aggregate sequence and continues with live events when follow=true.
*/
public log<ThrowOnError extends boolean = false>(
parameters: {
@ -6364,7 +6364,7 @@ export class Session3 extends HeyApiClient {
],
)
return (options?.client ?? this.client).sse.get<V2SessionLogResponses, V2SessionLogErrors, ThrowOnError>({
url: "/api/session/{sessionID}/log",
url: "/api/experimental/session/{sessionID}/log",
...options,
...params,
})
@ -7032,6 +7032,18 @@ export class Credential extends HeyApiClient {
}
export class Project2 extends HeyApiClient {
/**
* List projects
*
* List known projects.
*/
public list<ThrowOnError extends boolean = false>(options?: Options<never, ThrowOnError>) {
return (options?.client ?? this.client).get<V2ProjectListResponses, V2ProjectListErrors, ThrowOnError>({
url: "/api/project",
...options,
})
}
/**
* Get current project
*
@ -7357,7 +7369,7 @@ export class Event2 extends HeyApiClient {
/**
* Subscribe to events
*
* Subscribe to native event payloads for the server. Volatile by contract: a slow consumer overflows and fails the stream, and events during disconnection are missed. Consumers that need reliability should combine the changes feed with durable session log reads.
* Subscribe to native event payloads for the server. Volatile by contract: a slow consumer overflows and fails the stream, and events during disconnection are missed.
*/
public subscribe<ThrowOnError extends boolean = false>(options?: Options<never, ThrowOnError>) {
return (options?.client ?? this.client).sse.get<V2EventSubscribeResponses, V2EventSubscribeErrors, ThrowOnError>({
@ -7365,18 +7377,6 @@ export class Event2 extends HeyApiClient {
...options,
})
}
/**
* Subscribe to change hints
*
* Payload-free hint channel: after an event commits, a subscriber eventually receives a hint for that aggregate with seq at or beyond the event, or a sweep-required marker. Hints coalesce to the latest seq per aggregate under backpressure and the stream never fails from overflow. No consumer may derive correctness from receiving a hint; correctness always comes from durable log reads plus the consumer's own checkpoint. A sweep-required marker is emitted first on every (re)subscribe and whenever hint retention is exceeded: treat every aggregate as potentially dirty and recover via bounded sweep plus log reads.
*/
public changes<ThrowOnError extends boolean = false>(options?: Options<never, ThrowOnError>) {
return (options?.client ?? this.client).sse.get<V2EventChangesResponses, V2EventChangesErrors, ThrowOnError>({
url: "/api/event/changes",
...options,
})
}
}
export class Pty2 extends HeyApiClient {

View file

@ -2796,13 +2796,8 @@ export type UnauthorizedError = {
message: string
}
export type SessionWatermarks = {
[key: string]: unknown | number
}
export type SessionsResponse = {
data: Array<SessionV2Info>
watermarks: SessionWatermarks
cursor: {
previous?: string
next?: string
@ -2930,7 +2925,6 @@ export type SessionLogItemStream = string
export type SessionMessagesResponse = {
data: Array<SessionMessage>
watermark?: number
cursor: {
previous?: string
next?: string
@ -6615,20 +6609,6 @@ export type GlobalDisposed = {
}
}
export type EventLogHint = {
type: "log.hint"
aggregateID: string
seq: number
}
export type EventLogSweepRequired = {
type: "log.sweep_required"
}
export type EventLogChange = EventLogHint | EventLogSweepRequired
export type EventLogChangeStream = string
export type QuestionV2Request = {
id: string
sessionID: string
@ -7859,16 +7839,8 @@ export type SessionV2Info2 = {
revert?: RevertState2
}
/**
* Durable log seq each session's snapshot was computed at. Attach a live log read after the watermark to compose fetch and stream gap-free; apply a snapshot only where its watermark is at or beyond already-applied events. Sessions without durable events are absent.
*/
export type SessionWatermarksV2 = {
[key: string]: unknown | number
}
export type SessionsResponseV2 = {
data: Array<SessionV2Info2>
watermarks: SessionWatermarksV2
cursor: {
previous?: string | null
next?: string | null
@ -9059,7 +9031,6 @@ export type SessionLogItemStreamV2 = string
export type SessionMessagesResponseV2 = {
data: Array<SessionMessage2>
watermark?: number
cursor: {
previous?: string | null
next?: string | null
@ -9329,6 +9300,38 @@ export type McpServer2 = {
integrationID?: string
}
export type ProjectVcs2 = "git" | "hg"
export type ProjectIcon2 = {
url?: string
override?: string
color?: string
}
export type ProjectCommands2 = {
/**
* Startup script to run when creating a new workspace (worktree)
*/
start?: string
}
export type ProjectTime2 = {
created: number
updated: number
initialized?: number
}
export type ProjectV2 = {
id: string
worktree: string
vcs?: ProjectVcs2
name?: string
icon?: ProjectIcon2
commands?: ProjectCommands2
time: ProjectTime2
sandboxes: Array<string>
}
export type ProjectCurrent2 = {
id: string
directory: string
@ -11276,26 +11279,6 @@ export type V2EventV2 =
export type V2EventStreamV2 = string
/**
* Payload-free change hint: the aggregate's durable log advanced to at least seq. Hints coalesce under backpressure (latest per aggregate) and are never a delivery guarantee.
*/
export type EventLogHint2 = {
type: "log.hint"
aggregateID: string
seq: number
}
/**
* Hints may have been lost; treat every aggregate as potentially dirty and recover via bounded sweep plus durable log reads. Emitted first on every (re)subscribe.
*/
export type EventLogSweepRequired2 = {
type: "log.sweep_required"
}
export type EventLogChange2 = EventLogHint2 | EventLogSweepRequired2
export type EventLogChangeStream2 = string
export type PtyNotFoundErrorV2 = {
_tag: "PtyNotFoundError"
ptyID: string
@ -15770,7 +15753,6 @@ export type V2SessionActiveResponses = {
data: {
[key: string]: unknown | SessionActiveV2
}
watermarks: SessionWatermarksV2
}
}
@ -16563,7 +16545,7 @@ export type V2SessionLogData = {
after?: number | null
follow?: "true" | "false" | null
}
url: "/api/session/{sessionID}/log"
url: "/api/experimental/session/{sessionID}/log"
}
export type V2SessionLogErrors = {
@ -17353,6 +17335,35 @@ export type V2CredentialUpdateResponses = {
export type V2CredentialUpdateResponse = V2CredentialUpdateResponses[keyof V2CredentialUpdateResponses]
export type V2ProjectListData = {
body?: never
path?: never
query?: never
url: "/api/project"
}
export type V2ProjectListErrors = {
/**
* InvalidRequestError
*/
400: InvalidRequestErrorV2
/**
* UnauthorizedError
*/
401: UnauthorizedErrorV2
}
export type V2ProjectListError = V2ProjectListErrors[keyof V2ProjectListErrors]
export type V2ProjectListResponses = {
/**
* Success
*/
200: Array<ProjectV2>
}
export type V2ProjectListResponse = V2ProjectListResponses[keyof V2ProjectListResponses]
export type V2ProjectCurrentData = {
body?: never
path?: never
@ -18176,39 +18187,6 @@ export type V2EventSubscribeResponses = {
export type V2EventSubscribeResponse = V2EventSubscribeResponses[keyof V2EventSubscribeResponses]
export type V2EventChangesData = {
body?: never
path?: never
query?: never
url: "/api/event/changes"
}
export type V2EventChangesErrors = {
/**
* InvalidRequestError
*/
400: InvalidRequestErrorV2
/**
* UnauthorizedError
*/
401: UnauthorizedErrorV2
}
export type V2EventChangesError = V2EventChangesErrors[keyof V2EventChangesErrors]
export type V2EventChangesResponses = {
/**
* Success
*/
200: {
id: string | null
event: string
data: EventLogChangeStream2
}
}
export type V2EventChangesResponse = V2EventChangesResponses[keyof V2EventChangesResponses]
export type V2PtyListData = {
body?: never
path?: never