chore: upgrade Effect to beta.98 (#37498)
This commit is contained in:
parent
b26d948b76
commit
44f7bb71c1
37 changed files with 316 additions and 138 deletions
|
|
@ -141,7 +141,7 @@ if (sessionMessagesTypesPatched === sessionListTypesPatched) {
|
|||
throw new Error("Session messages numeric query patch did not apply")
|
||||
}
|
||||
const eventSubscribeTypesPatched = sessionMessagesTypesPatched.replace(
|
||||
/(export type V2EventSubscribeResponses = \{\s*\/\*\*[\s\S]*?\*\/\s*200: )\{\s*id: string \| null;?\s*event: string;?\s*data: V2EventStream(?:V2)?;?\s*\};?/,
|
||||
/(export type V2EventSubscribeResponses = \{\s*\/\*\*[\s\S]*?\*\/\s*200: )\{\s*id: string \| null;?\s*event: string;?\s*data: (?:V2EventStream(?:V2)?|V2EventJsonString);?\s*\};?/,
|
||||
"$1V2Event",
|
||||
)
|
||||
if (eventSubscribeTypesPatched === sessionMessagesTypesPatched) {
|
||||
|
|
|
|||
|
|
@ -398,6 +398,8 @@ import type {
|
|||
V2SessionFormReplyResponses,
|
||||
V2SessionFormStateErrors,
|
||||
V2SessionFormStateResponses,
|
||||
V2SessionGenerateErrors,
|
||||
V2SessionGenerateResponses,
|
||||
V2SessionGetErrors,
|
||||
V2SessionGetResponses,
|
||||
V2SessionInstructionsEntryListErrors,
|
||||
|
|
@ -6475,6 +6477,41 @@ export class Session3 extends HeyApiClient {
|
|||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate text from session context
|
||||
*
|
||||
* Generate transient text from the current session context without mutating session history.
|
||||
*/
|
||||
public generate<ThrowOnError extends boolean = false>(
|
||||
parameters: {
|
||||
sessionID: string
|
||||
prompt?: string
|
||||
},
|
||||
options?: Options<never, ThrowOnError>,
|
||||
) {
|
||||
const params = buildClientParams(
|
||||
[parameters],
|
||||
[
|
||||
{
|
||||
args: [
|
||||
{ in: "path", key: "sessionID" },
|
||||
{ in: "body", key: "prompt" },
|
||||
],
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).post<V2SessionGenerateResponses, V2SessionGenerateErrors, ThrowOnError>({
|
||||
url: "/api/session/{sessionID}/generate",
|
||||
...options,
|
||||
...params,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
...options?.headers,
|
||||
...params.headers,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Read the session log
|
||||
*
|
||||
|
|
|
|||
|
|
@ -2089,6 +2089,7 @@ export type Config = {
|
|||
batch_tool?: boolean
|
||||
openTelemetry?: boolean
|
||||
primary_tools?: Array<string>
|
||||
subagent_depth?: number
|
||||
continue_loop_on_deny?: boolean
|
||||
mcp_timeout?: number
|
||||
}
|
||||
|
|
@ -2888,9 +2889,15 @@ export type InstructionEntryValueTooLargeError = {
|
|||
message: string
|
||||
}
|
||||
|
||||
export type SessionGenerateResponse = {
|
||||
data: {
|
||||
text: string
|
||||
}
|
||||
}
|
||||
|
||||
export type SessionLogItem = SessionEventDurable | EventLogSynced
|
||||
|
||||
export type SessionLogItemStream = string
|
||||
export type SessionLogItemJsonString = string
|
||||
|
||||
export type SessionMessagesResponse = {
|
||||
data: Array<SessionMessageInfo>
|
||||
|
|
@ -3102,7 +3109,7 @@ export type V2Event =
|
|||
| ServerConnected
|
||||
| GlobalDisposed
|
||||
|
||||
export type V2EventStream = string
|
||||
export type V2EventJsonString = string
|
||||
|
||||
export type ForbiddenError = {
|
||||
_tag: "ForbiddenError"
|
||||
|
|
@ -5552,6 +5559,27 @@ export type SessionRevertCommitted = {
|
|||
}
|
||||
}
|
||||
|
||||
export type SessionUsageRecorded = {
|
||||
id: string
|
||||
created: number
|
||||
metadata?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
type: "session.usage.recorded"
|
||||
durable: {
|
||||
aggregateID: string
|
||||
seq: number
|
||||
version: 1
|
||||
}
|
||||
location?: LocationRef
|
||||
data: {
|
||||
sessionID: string
|
||||
source: "title" | "compaction"
|
||||
cost: MoneyUsd
|
||||
tokens: TokenUsageInfo
|
||||
}
|
||||
}
|
||||
|
||||
export type SessionEventDurable =
|
||||
| SessionAgentSelected
|
||||
| SessionModelSelected
|
||||
|
|
@ -5591,6 +5619,7 @@ export type SessionEventDurable =
|
|||
| SessionRevertStaged
|
||||
| SessionRevertCleared
|
||||
| SessionRevertCommitted
|
||||
| SessionUsageRecorded
|
||||
|
||||
export type EventLogSynced = {
|
||||
type: "log.synced"
|
||||
|
|
@ -9892,6 +9921,27 @@ export type SessionRevertCommittedV2 = {
|
|||
}
|
||||
}
|
||||
|
||||
export type SessionUsageRecordedV2 = {
|
||||
id: string
|
||||
created: number
|
||||
metadata?: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
type: "session.usage.recorded"
|
||||
durable: {
|
||||
aggregateID: string
|
||||
seq: number
|
||||
version: 1
|
||||
}
|
||||
location?: LocationRefV2
|
||||
data: {
|
||||
sessionID: string
|
||||
source: "title" | "compaction"
|
||||
cost: MoneyUsd
|
||||
tokens: TokenUsageInfo
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Marker emitted once when a log read reaches its captured watermark. The reader holds every event committed at or below seq.
|
||||
*/
|
||||
|
|
@ -16373,6 +16423,47 @@ export type V2SessionInstructionsEntryPutResponses = {
|
|||
export type V2SessionInstructionsEntryPutResponse =
|
||||
V2SessionInstructionsEntryPutResponses[keyof V2SessionInstructionsEntryPutResponses]
|
||||
|
||||
export type V2SessionGenerateData = {
|
||||
body: {
|
||||
prompt: string
|
||||
}
|
||||
path: {
|
||||
sessionID: string
|
||||
}
|
||||
query?: never
|
||||
url: "/api/session/{sessionID}/generate"
|
||||
}
|
||||
|
||||
export type V2SessionGenerateErrors = {
|
||||
/**
|
||||
* InvalidRequestError
|
||||
*/
|
||||
400: InvalidRequestErrorV2
|
||||
/**
|
||||
* UnauthorizedError
|
||||
*/
|
||||
401: UnauthorizedError
|
||||
/**
|
||||
* SessionNotFoundError
|
||||
*/
|
||||
404: SessionNotFoundError
|
||||
/**
|
||||
* ServiceUnavailableError
|
||||
*/
|
||||
503: ServiceUnavailableErrorV2
|
||||
}
|
||||
|
||||
export type V2SessionGenerateError = V2SessionGenerateErrors[keyof V2SessionGenerateErrors]
|
||||
|
||||
export type V2SessionGenerateResponses = {
|
||||
/**
|
||||
* SessionGenerateResponse
|
||||
*/
|
||||
200: SessionGenerateResponse
|
||||
}
|
||||
|
||||
export type V2SessionGenerateResponse = V2SessionGenerateResponses[keyof V2SessionGenerateResponses]
|
||||
|
||||
export type V2SessionLogData = {
|
||||
body?: never
|
||||
path: {
|
||||
|
|
@ -16409,7 +16500,7 @@ export type V2SessionLogResponses = {
|
|||
200: {
|
||||
id: string | null
|
||||
event: string
|
||||
data: SessionLogItemStream
|
||||
data: SessionLogItemJsonString
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue