Merge remote-tracking branch 'origin/v2' into nxl/vcs-plugin-api
# Conflicts: # packages/core/src/config.ts # packages/core/src/plugin/internal.ts # packages/core/src/project.ts # packages/core/test/project.test.ts # packages/plugin/src/v2/effect/context.ts # packages/plugin/src/v2/effect/index.ts
This commit is contained in:
commit
8ede176244
599 changed files with 83198 additions and 11394 deletions
|
|
@ -59,7 +59,13 @@ if (schemas) {
|
|||
}
|
||||
visit({ ...document, components: { ...document.components, schemas: undefined } })
|
||||
for (const name of Object.keys(schemas)) {
|
||||
if (/^SessionNext\w+1$/.test(name) && !reachable.has(name)) delete schemas[name]
|
||||
if (
|
||||
/^(SessionAgentSelected|SessionModelSelected|SessionMoved|SessionRenamed|SessionForked|SessionPromptPromoted|SessionPromptAdmitted|SessionExecutionSettled|SessionContextUpdated|SessionSynthetic|SessionSkillActivated|SessionShellStarted|SessionShellEnded|SessionStepStarted|SessionStepEnded|SessionStepFailed|SessionTextStarted|SessionTextDelta|SessionTextEnded|SessionReasoningStarted|SessionReasoningDelta|SessionReasoningEnded|SessionToolInputStarted|SessionToolInputDelta|SessionToolInputEnded|SessionToolCalled|SessionToolProgress|SessionToolSuccess|SessionToolFailed|SessionRetried|SessionCompactionStarted|SessionCompactionDelta|SessionCompactionEnded|SessionRevertStaged|SessionRevertCleared|SessionRevertCommitted)1$/.test(
|
||||
name,
|
||||
) &&
|
||||
!reachable.has(name)
|
||||
)
|
||||
delete schemas[name]
|
||||
}
|
||||
await Bun.write("./openapi.json", JSON.stringify(document))
|
||||
}
|
||||
|
|
@ -93,7 +99,11 @@ await createClient({
|
|||
|
||||
const generatedTypesPath = "./src/v2/gen/types.gen.ts"
|
||||
const generatedTypes = await Bun.file(generatedTypesPath).text()
|
||||
if (/export type SessionNext\w+1 =/.test(generatedTypes)) {
|
||||
if (
|
||||
/export type (SessionAgentSelected|SessionModelSelected|SessionMoved|SessionRenamed|SessionForked|SessionPromptPromoted|SessionPromptAdmitted|SessionExecutionSettled|SessionContextUpdated|SessionSynthetic|SessionSkillActivated|SessionShellStarted|SessionShellEnded|SessionStepStarted|SessionStepEnded|SessionStepFailed|SessionTextStarted|SessionTextDelta|SessionTextEnded|SessionReasoningStarted|SessionReasoningDelta|SessionReasoningEnded|SessionToolInputStarted|SessionToolInputDelta|SessionToolInputEnded|SessionToolCalled|SessionToolProgress|SessionToolSuccess|SessionToolFailed|SessionRetried|SessionCompactionStarted|SessionCompactionDelta|SessionCompactionEnded|SessionRevertStaged|SessionRevertCleared|SessionRevertCommitted)1 =/.test(
|
||||
generatedTypes,
|
||||
)
|
||||
) {
|
||||
throw new Error("Session history generated duplicate Session event variants")
|
||||
}
|
||||
const logTypesPatched = generatedTypes.replace(
|
||||
|
|
|
|||
|
|
@ -276,6 +276,8 @@ import type {
|
|||
V2CredentialRemoveResponses,
|
||||
V2CredentialUpdateErrors,
|
||||
V2CredentialUpdateResponses,
|
||||
V2DebugLocationErrors,
|
||||
V2DebugLocationResponses,
|
||||
V2EventChangesErrors,
|
||||
V2EventChangesResponses,
|
||||
V2EventSubscribeErrors,
|
||||
|
|
@ -332,6 +334,8 @@ import type {
|
|||
V2ProjectCurrentResponses,
|
||||
V2ProjectDirectoriesErrors,
|
||||
V2ProjectDirectoriesResponses,
|
||||
V2ProjectListErrors,
|
||||
V2ProjectListResponses,
|
||||
V2ProviderGetErrors,
|
||||
V2ProviderGetResponses,
|
||||
V2ProviderListErrors,
|
||||
|
|
@ -422,6 +426,8 @@ import type {
|
|||
V2SessionRevertCommitResponses,
|
||||
V2SessionRevertStageErrors,
|
||||
V2SessionRevertStageResponses,
|
||||
V2SessionShellErrors,
|
||||
V2SessionShellResponses,
|
||||
V2SessionSkillErrors,
|
||||
V2SessionSkillResponses,
|
||||
V2SessionSwitchAgentErrors,
|
||||
|
|
@ -6240,6 +6246,43 @@ export class Session3 extends HeyApiClient {
|
|||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Run shell command
|
||||
*
|
||||
* Execute one shell command in the session's working directory. Emits a shell.started event before execution and a shell.ended event with the merged output after.
|
||||
*/
|
||||
public shell<ThrowOnError extends boolean = false>(
|
||||
parameters: {
|
||||
sessionID: string
|
||||
id?: string | null
|
||||
command?: string
|
||||
},
|
||||
options?: Options<never, ThrowOnError>,
|
||||
) {
|
||||
const params = buildClientParams(
|
||||
[parameters],
|
||||
[
|
||||
{
|
||||
args: [
|
||||
{ in: "path", key: "sessionID" },
|
||||
{ in: "body", key: "id" },
|
||||
{ in: "body", key: "command" },
|
||||
],
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).post<V2SessionShellResponses, V2SessionShellErrors, ThrowOnError>({
|
||||
url: "/api/session/{sessionID}/shell",
|
||||
...options,
|
||||
...params,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
...options?.headers,
|
||||
...params.headers,
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Compact session
|
||||
*
|
||||
|
|
@ -6991,6 +7034,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
|
||||
*
|
||||
|
|
@ -7997,6 +8052,20 @@ export class Vcs2 extends HeyApiClient {
|
|||
}
|
||||
}
|
||||
|
||||
export class Debug extends HeyApiClient {
|
||||
/**
|
||||
* List loaded locations
|
||||
*
|
||||
* List locations currently loaded by the server.
|
||||
*/
|
||||
public location<ThrowOnError extends boolean = false>(options?: Options<never, ThrowOnError>) {
|
||||
return (options?.client ?? this.client).get<V2DebugLocationResponses, V2DebugLocationErrors, ThrowOnError>({
|
||||
url: "/api/debug/location",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export class V2 extends HeyApiClient {
|
||||
private _health?: Health
|
||||
get health(): Health {
|
||||
|
|
@ -8117,6 +8186,11 @@ export class V2 extends HeyApiClient {
|
|||
get vcs(): Vcs2 {
|
||||
return (this._vcs ??= new Vcs2({ client: this.client }))
|
||||
}
|
||||
|
||||
private _debug?: Debug
|
||||
get debug(): Debug {
|
||||
return (this._debug ??= new Debug({ client: this.client }))
|
||||
}
|
||||
}
|
||||
|
||||
export class OpencodeClient extends HeyApiClient {
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -16410,7 +16410,7 @@
|
|||
"text": {
|
||||
"type": "string"
|
||||
},
|
||||
"synthetic": {
|
||||
"session.synthetic": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"ignored": {
|
||||
|
|
@ -23071,7 +23071,7 @@
|
|||
"text": {
|
||||
"type": "string"
|
||||
},
|
||||
"synthetic": {
|
||||
"session.synthetic": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"ignored": {
|
||||
|
|
@ -27479,7 +27479,7 @@
|
|||
},
|
||||
"type": {
|
||||
"type": "string",
|
||||
"enum": ["synthetic"]
|
||||
"enum": ["session.synthetic"]
|
||||
}
|
||||
},
|
||||
"required": ["id", "time", "sessionID", "text", "type"],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue