Merge branch 'dev' into K-Mistele/dev
This commit is contained in:
commit
a584c0fb9f
1603 changed files with 293320 additions and 24559 deletions
|
|
@ -1,4 +1,5 @@
|
|||
import { createOpencodeClient, createOpencodeServer } from "@opencode-ai/sdk"
|
||||
import { pathToFileURL } from "bun"
|
||||
|
||||
const server = await createOpencodeServer()
|
||||
const client = createOpencodeClient({ baseUrl: server.url })
|
||||
|
|
@ -17,7 +18,7 @@ for await (const file of input) {
|
|||
{
|
||||
type: "file",
|
||||
mime: "text/plain",
|
||||
url: `file://${file}`,
|
||||
url: pathToFileURL(file).href,
|
||||
},
|
||||
{
|
||||
type: "text",
|
||||
|
|
@ -41,7 +42,7 @@ await Promise.all(
|
|||
{
|
||||
type: "file",
|
||||
mime: "text/plain",
|
||||
url: `file://${file}`,
|
||||
url: pathToFileURL(file).href,
|
||||
},
|
||||
{
|
||||
type: "text",
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"$schema": "https://json.schemastore.org/package.json",
|
||||
"name": "@opencode-ai/sdk",
|
||||
"version": "1.1.26",
|
||||
"version": "1.1.59",
|
||||
"type": "module",
|
||||
"license": "MIT",
|
||||
"scripts": {
|
||||
|
|
@ -20,7 +20,7 @@
|
|||
"dist"
|
||||
],
|
||||
"devDependencies": {
|
||||
"@hey-api/openapi-ts": "0.90.4",
|
||||
"@hey-api/openapi-ts": "0.90.10",
|
||||
"@tsconfig/node22": "catalog:",
|
||||
"@types/node": "catalog:",
|
||||
"typescript": "catalog:",
|
||||
|
|
|
|||
|
|
@ -6,13 +6,10 @@ import { $ } from "bun"
|
|||
const dir = new URL("..", import.meta.url).pathname
|
||||
process.chdir(dir)
|
||||
|
||||
await import("./build")
|
||||
|
||||
const pkg = await import("../package.json").then((m) => m.default)
|
||||
const original = JSON.parse(JSON.stringify(pkg))
|
||||
for (const [key, value] of Object.entries(pkg.exports)) {
|
||||
const file = value.replace("./src/", "./dist/").replace(".ts", "")
|
||||
/// @ts-expect-error
|
||||
pkg.exports[key] = {
|
||||
import: file + ".js",
|
||||
types: file + ".d.ts",
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ export function createOpencodeClient(config?: Config & { directory?: string }) {
|
|||
if (config?.directory) {
|
||||
config.headers = {
|
||||
...config.headers,
|
||||
"x-opencode-directory": config.directory,
|
||||
"x-opencode-directory": encodeURIComponent(config.directory),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1554,7 +1554,7 @@ export type FileNode = {
|
|||
}
|
||||
|
||||
export type FileContent = {
|
||||
type: "text"
|
||||
type: "text" | "binary"
|
||||
content: string
|
||||
diff?: string
|
||||
patch?: {
|
||||
|
|
|
|||
|
|
@ -9,10 +9,12 @@ import type {
|
|||
AppLogResponses,
|
||||
AppSkillsResponses,
|
||||
Auth as Auth3,
|
||||
AuthRemoveErrors,
|
||||
AuthRemoveResponses,
|
||||
AuthSetErrors,
|
||||
AuthSetResponses,
|
||||
CommandListResponses,
|
||||
Config as Config2,
|
||||
Config as Config3,
|
||||
ConfigGetResponses,
|
||||
ConfigProvidersResponses,
|
||||
ConfigUpdateErrors,
|
||||
|
|
@ -32,6 +34,9 @@ import type {
|
|||
FindSymbolsResponses,
|
||||
FindTextResponses,
|
||||
FormatterStatusResponses,
|
||||
GlobalConfigGetResponses,
|
||||
GlobalConfigUpdateErrors,
|
||||
GlobalConfigUpdateResponses,
|
||||
GlobalDisposeResponses,
|
||||
GlobalEventResponses,
|
||||
GlobalHealthResponses,
|
||||
|
|
@ -214,6 +219,44 @@ class HeyApiRegistry<T> {
|
|||
}
|
||||
}
|
||||
|
||||
export class Config extends HeyApiClient {
|
||||
/**
|
||||
* Get global configuration
|
||||
*
|
||||
* Retrieve the current global OpenCode configuration settings and preferences.
|
||||
*/
|
||||
public get<ThrowOnError extends boolean = false>(options?: Options<never, ThrowOnError>) {
|
||||
return (options?.client ?? this.client).get<GlobalConfigGetResponses, unknown, ThrowOnError>({
|
||||
url: "/global/config",
|
||||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Update global configuration
|
||||
*
|
||||
* Update global OpenCode configuration settings and preferences.
|
||||
*/
|
||||
public update<ThrowOnError extends boolean = false>(
|
||||
parameters?: {
|
||||
config?: Config3
|
||||
},
|
||||
options?: Options<never, ThrowOnError>,
|
||||
) {
|
||||
const params = buildClientParams([parameters], [{ args: [{ key: "config", map: "body" }] }])
|
||||
return (options?.client ?? this.client).patch<GlobalConfigUpdateResponses, GlobalConfigUpdateErrors, ThrowOnError>({
|
||||
url: "/global/config",
|
||||
...options,
|
||||
...params,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
...options?.headers,
|
||||
...params.headers,
|
||||
},
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export class Global extends HeyApiClient {
|
||||
/**
|
||||
* Get health
|
||||
|
|
@ -250,6 +293,67 @@ export class Global extends HeyApiClient {
|
|||
...options,
|
||||
})
|
||||
}
|
||||
|
||||
private _config?: Config
|
||||
get config(): Config {
|
||||
return (this._config ??= new Config({ client: this.client }))
|
||||
}
|
||||
}
|
||||
|
||||
export class Auth extends HeyApiClient {
|
||||
/**
|
||||
* Remove auth credentials
|
||||
*
|
||||
* Remove authentication credentials
|
||||
*/
|
||||
public remove<ThrowOnError extends boolean = false>(
|
||||
parameters: {
|
||||
providerID: string
|
||||
},
|
||||
options?: Options<never, ThrowOnError>,
|
||||
) {
|
||||
const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "providerID" }] }])
|
||||
return (options?.client ?? this.client).delete<AuthRemoveResponses, AuthRemoveErrors, ThrowOnError>({
|
||||
url: "/auth/{providerID}",
|
||||
...options,
|
||||
...params,
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Set auth credentials
|
||||
*
|
||||
* Set authentication credentials
|
||||
*/
|
||||
public set<ThrowOnError extends boolean = false>(
|
||||
parameters: {
|
||||
providerID: string
|
||||
auth?: Auth3
|
||||
},
|
||||
options?: Options<never, ThrowOnError>,
|
||||
) {
|
||||
const params = buildClientParams(
|
||||
[parameters],
|
||||
[
|
||||
{
|
||||
args: [
|
||||
{ in: "path", key: "providerID" },
|
||||
{ key: "auth", map: "body" },
|
||||
],
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).put<AuthSetResponses, AuthSetErrors, ThrowOnError>({
|
||||
url: "/auth/{providerID}",
|
||||
...options,
|
||||
...params,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
...options?.headers,
|
||||
...params.headers,
|
||||
},
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export class Project extends HeyApiClient {
|
||||
|
|
@ -294,7 +398,7 @@ export class Project extends HeyApiClient {
|
|||
/**
|
||||
* Update project
|
||||
*
|
||||
* Update project properties such as name, icon and color.
|
||||
* Update project properties such as name, icon, and commands.
|
||||
*/
|
||||
public update<ThrowOnError extends boolean = false>(
|
||||
parameters: {
|
||||
|
|
@ -306,6 +410,12 @@ export class Project extends HeyApiClient {
|
|||
override?: string
|
||||
color?: string
|
||||
}
|
||||
commands?: {
|
||||
/**
|
||||
* Startup script to run when creating a new workspace (worktree)
|
||||
*/
|
||||
start?: string
|
||||
}
|
||||
},
|
||||
options?: Options<never, ThrowOnError>,
|
||||
) {
|
||||
|
|
@ -318,6 +428,7 @@ export class Project extends HeyApiClient {
|
|||
{ in: "query", key: "directory" },
|
||||
{ in: "body", key: "name" },
|
||||
{ in: "body", key: "icon" },
|
||||
{ in: "body", key: "commands" },
|
||||
],
|
||||
},
|
||||
],
|
||||
|
|
@ -533,7 +644,7 @@ export class Pty extends HeyApiClient {
|
|||
}
|
||||
}
|
||||
|
||||
export class Config extends HeyApiClient {
|
||||
export class Config2 extends HeyApiClient {
|
||||
/**
|
||||
* Get configuration
|
||||
*
|
||||
|
|
@ -561,7 +672,7 @@ export class Config extends HeyApiClient {
|
|||
public update<ThrowOnError extends boolean = false>(
|
||||
parameters?: {
|
||||
directory?: string
|
||||
config?: Config2
|
||||
config?: Config3
|
||||
},
|
||||
options?: Options<never, ThrowOnError>,
|
||||
) {
|
||||
|
|
@ -719,7 +830,7 @@ export class Worktree extends HeyApiClient {
|
|||
/**
|
||||
* Create worktree
|
||||
*
|
||||
* Create a new git worktree for the current project.
|
||||
* Create a new git worktree for the current project and run any configured startup scripts.
|
||||
*/
|
||||
public create<ThrowOnError extends boolean = false>(
|
||||
parameters?: {
|
||||
|
|
@ -1363,7 +1474,7 @@ export class Session extends HeyApiClient {
|
|||
tools?: {
|
||||
[key: string]: boolean
|
||||
}
|
||||
outputFormat?: OutputFormat
|
||||
format?: OutputFormat
|
||||
system?: string
|
||||
variant?: string
|
||||
parts?: Array<TextPartInput | FilePartInput | AgentPartInput | SubtaskPartInput>
|
||||
|
|
@ -1382,7 +1493,7 @@ export class Session extends HeyApiClient {
|
|||
{ in: "body", key: "agent" },
|
||||
{ in: "body", key: "noReply" },
|
||||
{ in: "body", key: "tools" },
|
||||
{ in: "body", key: "outputFormat" },
|
||||
{ in: "body", key: "format" },
|
||||
{ in: "body", key: "system" },
|
||||
{ in: "body", key: "variant" },
|
||||
{ in: "body", key: "parts" },
|
||||
|
|
@ -1453,7 +1564,7 @@ export class Session extends HeyApiClient {
|
|||
tools?: {
|
||||
[key: string]: boolean
|
||||
}
|
||||
outputFormat?: OutputFormat
|
||||
format?: OutputFormat
|
||||
system?: string
|
||||
variant?: string
|
||||
parts?: Array<TextPartInput | FilePartInput | AgentPartInput | SubtaskPartInput>
|
||||
|
|
@ -1472,7 +1583,7 @@ export class Session extends HeyApiClient {
|
|||
{ in: "body", key: "agent" },
|
||||
{ in: "body", key: "noReply" },
|
||||
{ in: "body", key: "tools" },
|
||||
{ in: "body", key: "outputFormat" },
|
||||
{ in: "body", key: "format" },
|
||||
{ in: "body", key: "system" },
|
||||
{ in: "body", key: "variant" },
|
||||
{ in: "body", key: "parts" },
|
||||
|
|
@ -2234,7 +2345,7 @@ export class File extends HeyApiClient {
|
|||
}
|
||||
}
|
||||
|
||||
export class Auth extends HeyApiClient {
|
||||
export class Auth2 extends HeyApiClient {
|
||||
/**
|
||||
* Remove MCP OAuth
|
||||
*
|
||||
|
|
@ -2478,9 +2589,9 @@ export class Mcp extends HeyApiClient {
|
|||
})
|
||||
}
|
||||
|
||||
private _auth?: Auth
|
||||
get auth(): Auth {
|
||||
return (this._auth ??= new Auth({ client: this.client }))
|
||||
private _auth?: Auth2
|
||||
get auth(): Auth2 {
|
||||
return (this._auth ??= new Auth2({ client: this.client }))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2516,7 +2627,17 @@ export class Control extends HeyApiClient {
|
|||
},
|
||||
options?: Options<never, ThrowOnError>,
|
||||
) {
|
||||
const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }, { in: "body" }] }])
|
||||
const params = buildClientParams(
|
||||
[parameters],
|
||||
[
|
||||
{
|
||||
args: [
|
||||
{ in: "query", key: "directory" },
|
||||
{ key: "body", map: "body" },
|
||||
],
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).post<TuiControlResponseResponses, unknown, ThrowOnError>({
|
||||
url: "/tui/control/response",
|
||||
...options,
|
||||
|
|
@ -2768,7 +2889,17 @@ export class Tui extends HeyApiClient {
|
|||
},
|
||||
options?: Options<never, ThrowOnError>,
|
||||
) {
|
||||
const params = buildClientParams([parameters], [{ args: [{ in: "query", key: "directory" }, { in: "body" }] }])
|
||||
const params = buildClientParams(
|
||||
[parameters],
|
||||
[
|
||||
{
|
||||
args: [
|
||||
{ in: "query", key: "directory" },
|
||||
{ key: "body", map: "body" },
|
||||
],
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).post<TuiPublishResponses, TuiPublishErrors, ThrowOnError>({
|
||||
url: "/tui/publish",
|
||||
...options,
|
||||
|
|
@ -3031,45 +3162,6 @@ export class Formatter extends HeyApiClient {
|
|||
}
|
||||
}
|
||||
|
||||
export class Auth2 extends HeyApiClient {
|
||||
/**
|
||||
* Set auth credentials
|
||||
*
|
||||
* Set authentication credentials
|
||||
*/
|
||||
public set<ThrowOnError extends boolean = false>(
|
||||
parameters: {
|
||||
providerID: string
|
||||
directory?: string
|
||||
auth?: Auth3
|
||||
},
|
||||
options?: Options<never, ThrowOnError>,
|
||||
) {
|
||||
const params = buildClientParams(
|
||||
[parameters],
|
||||
[
|
||||
{
|
||||
args: [
|
||||
{ in: "path", key: "providerID" },
|
||||
{ in: "query", key: "directory" },
|
||||
{ key: "auth", map: "body" },
|
||||
],
|
||||
},
|
||||
],
|
||||
)
|
||||
return (options?.client ?? this.client).put<AuthSetResponses, AuthSetErrors, ThrowOnError>({
|
||||
url: "/auth/{providerID}",
|
||||
...options,
|
||||
...params,
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
...options?.headers,
|
||||
...params.headers,
|
||||
},
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export class Event extends HeyApiClient {
|
||||
/**
|
||||
* Subscribe to events
|
||||
|
|
@ -3104,6 +3196,11 @@ export class OpencodeClient extends HeyApiClient {
|
|||
return (this._global ??= new Global({ client: this.client }))
|
||||
}
|
||||
|
||||
private _auth?: Auth
|
||||
get auth(): Auth {
|
||||
return (this._auth ??= new Auth({ client: this.client }))
|
||||
}
|
||||
|
||||
private _project?: Project
|
||||
get project(): Project {
|
||||
return (this._project ??= new Project({ client: this.client }))
|
||||
|
|
@ -3114,9 +3211,9 @@ export class OpencodeClient extends HeyApiClient {
|
|||
return (this._pty ??= new Pty({ client: this.client }))
|
||||
}
|
||||
|
||||
private _config?: Config
|
||||
get config(): Config {
|
||||
return (this._config ??= new Config({ client: this.client }))
|
||||
private _config?: Config2
|
||||
get config(): Config2 {
|
||||
return (this._config ??= new Config2({ client: this.client }))
|
||||
}
|
||||
|
||||
private _tool?: Tool
|
||||
|
|
@ -3214,11 +3311,6 @@ export class OpencodeClient extends HeyApiClient {
|
|||
return (this._formatter ??= new Formatter({ client: this.client }))
|
||||
}
|
||||
|
||||
private _auth?: Auth2
|
||||
get auth(): Auth2 {
|
||||
return (this._auth ??= new Auth2({ client: this.client }))
|
||||
}
|
||||
|
||||
private _event?: Event
|
||||
get event(): Event {
|
||||
return (this._event ??= new Event({ client: this.client }))
|
||||
|
|
|
|||
|
|
@ -28,6 +28,12 @@ export type Project = {
|
|||
override?: string
|
||||
color?: string
|
||||
}
|
||||
commands?: {
|
||||
/**
|
||||
* Startup script to run when creating a new workspace (worktree)
|
||||
*/
|
||||
start?: string
|
||||
}
|
||||
time: {
|
||||
created: number
|
||||
updated: number
|
||||
|
|
@ -48,6 +54,20 @@ export type EventServerInstanceDisposed = {
|
|||
}
|
||||
}
|
||||
|
||||
export type EventServerConnected = {
|
||||
type: "server.connected"
|
||||
properties: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
}
|
||||
|
||||
export type EventGlobalDisposed = {
|
||||
type: "global.disposed"
|
||||
properties: {
|
||||
[key: string]: unknown
|
||||
}
|
||||
}
|
||||
|
||||
export type EventLspClientDiagnostics = {
|
||||
type: "lsp.client.diagnostics"
|
||||
properties: {
|
||||
|
|
@ -63,6 +83,13 @@ export type EventLspUpdated = {
|
|||
}
|
||||
}
|
||||
|
||||
export type EventFileEdited = {
|
||||
type: "file.edited"
|
||||
properties: {
|
||||
file: string
|
||||
}
|
||||
}
|
||||
|
||||
export type OutputFormatText = {
|
||||
type: "text"
|
||||
}
|
||||
|
|
@ -79,19 +106,13 @@ export type OutputFormatJsonSchema = {
|
|||
|
||||
export type OutputFormat = OutputFormatText | OutputFormatJsonSchema
|
||||
|
||||
export type EventFileEdited = {
|
||||
type: "file.edited"
|
||||
properties: {
|
||||
file: string
|
||||
}
|
||||
}
|
||||
|
||||
export type FileDiff = {
|
||||
file: string
|
||||
before: string
|
||||
after: string
|
||||
additions: number
|
||||
deletions: number
|
||||
status?: "added" | "deleted" | "modified"
|
||||
}
|
||||
|
||||
export type UserMessage = {
|
||||
|
|
@ -101,7 +122,7 @@ export type UserMessage = {
|
|||
time: {
|
||||
created: number
|
||||
}
|
||||
outputFormat?: OutputFormat
|
||||
format?: OutputFormat
|
||||
summary?: {
|
||||
title?: string
|
||||
body?: string
|
||||
|
|
@ -156,6 +177,14 @@ export type StructuredOutputError = {
|
|||
}
|
||||
}
|
||||
|
||||
export type ContextOverflowError = {
|
||||
name: "ContextOverflowError"
|
||||
data: {
|
||||
message: string
|
||||
responseBody?: string
|
||||
}
|
||||
}
|
||||
|
||||
export type ApiError = {
|
||||
name: "APIError"
|
||||
data: {
|
||||
|
|
@ -186,6 +215,7 @@ export type AssistantMessage = {
|
|||
| MessageOutputLengthError
|
||||
| MessageAbortedError
|
||||
| StructuredOutputError
|
||||
| ContextOverflowError
|
||||
| ApiError
|
||||
parentID: string
|
||||
modelID: string
|
||||
|
|
@ -199,6 +229,7 @@ export type AssistantMessage = {
|
|||
summary?: boolean
|
||||
cost: number
|
||||
tokens: {
|
||||
total?: number
|
||||
input: number
|
||||
output: number
|
||||
reasoning: number
|
||||
|
|
@ -207,7 +238,8 @@ export type AssistantMessage = {
|
|||
write: number
|
||||
}
|
||||
}
|
||||
structured_output?: unknown
|
||||
structured?: unknown
|
||||
variant?: string
|
||||
finish?: string
|
||||
}
|
||||
|
||||
|
|
@ -245,6 +277,21 @@ export type TextPart = {
|
|||
}
|
||||
}
|
||||
|
||||
export type SubtaskPart = {
|
||||
id: string
|
||||
sessionID: string
|
||||
messageID: string
|
||||
type: "subtask"
|
||||
prompt: string
|
||||
description: string
|
||||
agent: string
|
||||
model?: {
|
||||
providerID: string
|
||||
modelID: string
|
||||
}
|
||||
command?: string
|
||||
}
|
||||
|
||||
export type ReasoningPart = {
|
||||
id: string
|
||||
sessionID: string
|
||||
|
|
@ -399,6 +446,7 @@ export type StepFinishPart = {
|
|||
snapshot?: string
|
||||
cost: number
|
||||
tokens: {
|
||||
total?: number
|
||||
input: number
|
||||
output: number
|
||||
reasoning: number
|
||||
|
|
@ -461,20 +509,7 @@ export type CompactionPart = {
|
|||
|
||||
export type Part =
|
||||
| TextPart
|
||||
| {
|
||||
id: string
|
||||
sessionID: string
|
||||
messageID: string
|
||||
type: "subtask"
|
||||
prompt: string
|
||||
description: string
|
||||
agent: string
|
||||
model?: {
|
||||
providerID: string
|
||||
modelID: string
|
||||
}
|
||||
command?: string
|
||||
}
|
||||
| SubtaskPart
|
||||
| ReasoningPart
|
||||
| FilePart
|
||||
| ToolPart
|
||||
|
|
@ -639,6 +674,14 @@ export type EventSessionCompacted = {
|
|||
}
|
||||
}
|
||||
|
||||
export type EventFileWatcherUpdated = {
|
||||
type: "file.watcher.updated"
|
||||
properties: {
|
||||
file: string
|
||||
event: "add" | "change" | "unlink"
|
||||
}
|
||||
}
|
||||
|
||||
export type Todo = {
|
||||
/**
|
||||
* Brief description of the task
|
||||
|
|
@ -666,14 +709,6 @@ export type EventTodoUpdated = {
|
|||
}
|
||||
}
|
||||
|
||||
export type EventFileWatcherUpdated = {
|
||||
type: "file.watcher.updated"
|
||||
properties: {
|
||||
file: string
|
||||
event: "add" | "change" | "unlink"
|
||||
}
|
||||
}
|
||||
|
||||
export type EventTuiPromptAppend = {
|
||||
type: "tui.prompt.append"
|
||||
properties: {
|
||||
|
|
@ -834,6 +869,7 @@ export type EventSessionError = {
|
|||
| MessageOutputLengthError
|
||||
| MessageAbortedError
|
||||
| StructuredOutputError
|
||||
| ContextOverflowError
|
||||
| ApiError
|
||||
}
|
||||
}
|
||||
|
|
@ -884,17 +920,18 @@ export type EventPtyDeleted = {
|
|||
}
|
||||
}
|
||||
|
||||
export type EventGlobalDisposed = {
|
||||
type: "global.disposed"
|
||||
export type EventWorktreeReady = {
|
||||
type: "worktree.ready"
|
||||
properties: {
|
||||
[key: string]: unknown
|
||||
name: string
|
||||
branch: string
|
||||
}
|
||||
}
|
||||
|
||||
export type EventServerConnected = {
|
||||
type: "server.connected"
|
||||
export type EventWorktreeFailed = {
|
||||
type: "worktree.failed"
|
||||
properties: {
|
||||
[key: string]: unknown
|
||||
message: string
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -903,6 +940,8 @@ export type Event =
|
|||
| EventInstallationUpdateAvailable
|
||||
| EventProjectUpdated
|
||||
| EventServerInstanceDisposed
|
||||
| EventServerConnected
|
||||
| EventGlobalDisposed
|
||||
| EventLspClientDiagnostics
|
||||
| EventLspUpdated
|
||||
| EventFileEdited
|
||||
|
|
@ -918,8 +957,8 @@ export type Event =
|
|||
| EventQuestionReplied
|
||||
| EventQuestionRejected
|
||||
| EventSessionCompacted
|
||||
| EventTodoUpdated
|
||||
| EventFileWatcherUpdated
|
||||
| EventTodoUpdated
|
||||
| EventTuiPromptAppend
|
||||
| EventTuiCommandExecute
|
||||
| EventTuiToastShow
|
||||
|
|
@ -937,29 +976,14 @@ export type Event =
|
|||
| EventPtyUpdated
|
||||
| EventPtyExited
|
||||
| EventPtyDeleted
|
||||
| EventGlobalDisposed
|
||||
| EventServerConnected
|
||||
| EventWorktreeReady
|
||||
| EventWorktreeFailed
|
||||
|
||||
export type GlobalEvent = {
|
||||
directory: string
|
||||
payload: Event
|
||||
}
|
||||
|
||||
export type BadRequestError = {
|
||||
data: unknown
|
||||
errors: Array<{
|
||||
[key: string]: unknown
|
||||
}>
|
||||
success: false
|
||||
}
|
||||
|
||||
export type NotFoundError = {
|
||||
name: "NotFoundError"
|
||||
data: {
|
||||
message: string
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Custom keybind configurations
|
||||
*/
|
||||
|
|
@ -1336,6 +1360,10 @@ export type KeybindsConfig = {
|
|||
* Toggle tips on home screen
|
||||
*/
|
||||
tips_toggle?: string
|
||||
/**
|
||||
* Toggle thinking blocks visibility
|
||||
*/
|
||||
display_thinking?: string
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1359,6 +1387,10 @@ export type ServerConfig = {
|
|||
* Enable mDNS service discovery
|
||||
*/
|
||||
mdns?: boolean
|
||||
/**
|
||||
* Custom domain name for mDNS service (default: opencode.local)
|
||||
*/
|
||||
mdnsDomain?: string
|
||||
/**
|
||||
* Additional domains to allow for CORS
|
||||
*/
|
||||
|
|
@ -1392,12 +1424,17 @@ export type PermissionConfig =
|
|||
codesearch?: PermissionActionConfig
|
||||
lsp?: PermissionRuleConfig
|
||||
doom_loop?: PermissionActionConfig
|
||||
skill?: PermissionRuleConfig
|
||||
[key: string]: PermissionRuleConfig | Array<string> | PermissionActionConfig | undefined
|
||||
}
|
||||
| PermissionActionConfig
|
||||
|
||||
export type AgentConfig = {
|
||||
model?: string
|
||||
/**
|
||||
* Default model variant for this agent (applies only when using the agent's configured model).
|
||||
*/
|
||||
variant?: string
|
||||
temperature?: number
|
||||
top_p?: number
|
||||
prompt?: string
|
||||
|
|
@ -1421,9 +1458,9 @@ export type AgentConfig = {
|
|||
[key: string]: unknown
|
||||
}
|
||||
/**
|
||||
* Hex color code for the agent (e.g., #FF5733)
|
||||
* Hex color code (e.g., #FF5733) or theme color (e.g., primary)
|
||||
*/
|
||||
color?: string
|
||||
color?: string | "primary" | "secondary" | "accent" | "success" | "warning" | "error" | "info"
|
||||
/**
|
||||
* Maximum number of agentic iterations before forcing text-only response
|
||||
*/
|
||||
|
|
@ -1448,6 +1485,13 @@ export type AgentConfig = {
|
|||
[key: string]: unknown
|
||||
}
|
||||
| string
|
||||
| "primary"
|
||||
| "secondary"
|
||||
| "accent"
|
||||
| "success"
|
||||
| "warning"
|
||||
| "error"
|
||||
| "info"
|
||||
| number
|
||||
| PermissionConfig
|
||||
| undefined
|
||||
|
|
@ -1505,6 +1549,7 @@ export type ProviderConfig = {
|
|||
}
|
||||
provider?: {
|
||||
npm: string
|
||||
api: string
|
||||
}
|
||||
/**
|
||||
* Variant-specific configuration
|
||||
|
|
@ -1661,6 +1706,19 @@ export type Config = {
|
|||
subtask?: boolean
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Additional skill folder paths
|
||||
*/
|
||||
skills?: {
|
||||
/**
|
||||
* Additional paths to skill folders
|
||||
*/
|
||||
paths?: Array<string>
|
||||
/**
|
||||
* URLs to fetch skills from (e.g., https://example.com/.well-known/skills/)
|
||||
*/
|
||||
urls?: Array<string>
|
||||
}
|
||||
watcher?: {
|
||||
ignore?: Array<string>
|
||||
}
|
||||
|
|
@ -1795,28 +1853,12 @@ export type Config = {
|
|||
* Enable pruning of old tool outputs (default: true)
|
||||
*/
|
||||
prune?: boolean
|
||||
/**
|
||||
* Token buffer for compaction. Leaves enough window to avoid overflow during compaction.
|
||||
*/
|
||||
reserved?: number
|
||||
}
|
||||
experimental?: {
|
||||
hook?: {
|
||||
file_edited?: {
|
||||
[key: string]: Array<{
|
||||
command: Array<string>
|
||||
environment?: {
|
||||
[key: string]: string
|
||||
}
|
||||
}>
|
||||
}
|
||||
session_completed?: Array<{
|
||||
command: Array<string>
|
||||
environment?: {
|
||||
[key: string]: string
|
||||
}
|
||||
}>
|
||||
}
|
||||
/**
|
||||
* Number of retries for chat completions on failure
|
||||
*/
|
||||
chatMaxRetries?: number
|
||||
disable_paste_summary?: boolean
|
||||
/**
|
||||
* Enable the batch tool
|
||||
|
|
@ -1841,6 +1883,43 @@ export type Config = {
|
|||
}
|
||||
}
|
||||
|
||||
export type BadRequestError = {
|
||||
data: unknown
|
||||
errors: Array<{
|
||||
[key: string]: unknown
|
||||
}>
|
||||
success: false
|
||||
}
|
||||
|
||||
export type OAuth = {
|
||||
type: "oauth"
|
||||
refresh: string
|
||||
access: string
|
||||
expires: number
|
||||
accountId?: string
|
||||
enterpriseUrl?: string
|
||||
}
|
||||
|
||||
export type ApiAuth = {
|
||||
type: "api"
|
||||
key: string
|
||||
}
|
||||
|
||||
export type WellKnownAuth = {
|
||||
type: "wellknown"
|
||||
key: string
|
||||
token: string
|
||||
}
|
||||
|
||||
export type Auth = OAuth | ApiAuth | WellKnownAuth
|
||||
|
||||
export type NotFoundError = {
|
||||
name: "NotFoundError"
|
||||
data: {
|
||||
message: string
|
||||
}
|
||||
}
|
||||
|
||||
export type Model = {
|
||||
id: string
|
||||
providerID: string
|
||||
|
|
@ -1944,6 +2023,9 @@ export type Worktree = {
|
|||
|
||||
export type WorktreeCreateInput = {
|
||||
name?: string
|
||||
/**
|
||||
* Additional startup script to run after the project's start command
|
||||
*/
|
||||
startCommand?: string
|
||||
}
|
||||
|
||||
|
|
@ -2040,7 +2122,7 @@ export type FileNode = {
|
|||
}
|
||||
|
||||
export type FileContent = {
|
||||
type: "text"
|
||||
type: "text" | "binary"
|
||||
content: string
|
||||
diff?: string
|
||||
patch?: {
|
||||
|
|
@ -2114,7 +2196,7 @@ export type Command = {
|
|||
description?: string
|
||||
agent?: string
|
||||
model?: string
|
||||
mcp?: boolean
|
||||
source?: "command" | "mcp" | "skill"
|
||||
template: string
|
||||
subtask?: boolean
|
||||
hints: Array<string>
|
||||
|
|
@ -2134,6 +2216,7 @@ export type Agent = {
|
|||
modelID: string
|
||||
providerID: string
|
||||
}
|
||||
variant?: string
|
||||
prompt?: string
|
||||
options: {
|
||||
[key: string]: unknown
|
||||
|
|
@ -2154,28 +2237,6 @@ export type FormatterStatus = {
|
|||
enabled: boolean
|
||||
}
|
||||
|
||||
export type OAuth = {
|
||||
type: "oauth"
|
||||
refresh: string
|
||||
access: string
|
||||
expires: number
|
||||
accountId?: string
|
||||
enterpriseUrl?: string
|
||||
}
|
||||
|
||||
export type ApiAuth = {
|
||||
type: "api"
|
||||
key: string
|
||||
}
|
||||
|
||||
export type WellKnownAuth = {
|
||||
type: "wellknown"
|
||||
key: string
|
||||
token: string
|
||||
}
|
||||
|
||||
export type Auth = OAuth | ApiAuth | WellKnownAuth
|
||||
|
||||
export type GlobalHealthData = {
|
||||
body?: never
|
||||
path?: never
|
||||
|
|
@ -2211,6 +2272,47 @@ export type GlobalEventResponses = {
|
|||
|
||||
export type GlobalEventResponse = GlobalEventResponses[keyof GlobalEventResponses]
|
||||
|
||||
export type GlobalConfigGetData = {
|
||||
body?: never
|
||||
path?: never
|
||||
query?: never
|
||||
url: "/global/config"
|
||||
}
|
||||
|
||||
export type GlobalConfigGetResponses = {
|
||||
/**
|
||||
* Get global config info
|
||||
*/
|
||||
200: Config
|
||||
}
|
||||
|
||||
export type GlobalConfigGetResponse = GlobalConfigGetResponses[keyof GlobalConfigGetResponses]
|
||||
|
||||
export type GlobalConfigUpdateData = {
|
||||
body?: Config
|
||||
path?: never
|
||||
query?: never
|
||||
url: "/global/config"
|
||||
}
|
||||
|
||||
export type GlobalConfigUpdateErrors = {
|
||||
/**
|
||||
* Bad request
|
||||
*/
|
||||
400: BadRequestError
|
||||
}
|
||||
|
||||
export type GlobalConfigUpdateError = GlobalConfigUpdateErrors[keyof GlobalConfigUpdateErrors]
|
||||
|
||||
export type GlobalConfigUpdateResponses = {
|
||||
/**
|
||||
* Successfully updated global config
|
||||
*/
|
||||
200: Config
|
||||
}
|
||||
|
||||
export type GlobalConfigUpdateResponse = GlobalConfigUpdateResponses[keyof GlobalConfigUpdateResponses]
|
||||
|
||||
export type GlobalDisposeData = {
|
||||
body?: never
|
||||
path?: never
|
||||
|
|
@ -2227,6 +2329,60 @@ export type GlobalDisposeResponses = {
|
|||
|
||||
export type GlobalDisposeResponse = GlobalDisposeResponses[keyof GlobalDisposeResponses]
|
||||
|
||||
export type AuthRemoveData = {
|
||||
body?: never
|
||||
path: {
|
||||
providerID: string
|
||||
}
|
||||
query?: never
|
||||
url: "/auth/{providerID}"
|
||||
}
|
||||
|
||||
export type AuthRemoveErrors = {
|
||||
/**
|
||||
* Bad request
|
||||
*/
|
||||
400: BadRequestError
|
||||
}
|
||||
|
||||
export type AuthRemoveError = AuthRemoveErrors[keyof AuthRemoveErrors]
|
||||
|
||||
export type AuthRemoveResponses = {
|
||||
/**
|
||||
* Successfully removed authentication credentials
|
||||
*/
|
||||
200: boolean
|
||||
}
|
||||
|
||||
export type AuthRemoveResponse = AuthRemoveResponses[keyof AuthRemoveResponses]
|
||||
|
||||
export type AuthSetData = {
|
||||
body?: Auth
|
||||
path: {
|
||||
providerID: string
|
||||
}
|
||||
query?: never
|
||||
url: "/auth/{providerID}"
|
||||
}
|
||||
|
||||
export type AuthSetErrors = {
|
||||
/**
|
||||
* Bad request
|
||||
*/
|
||||
400: BadRequestError
|
||||
}
|
||||
|
||||
export type AuthSetError = AuthSetErrors[keyof AuthSetErrors]
|
||||
|
||||
export type AuthSetResponses = {
|
||||
/**
|
||||
* Successfully set authentication credentials
|
||||
*/
|
||||
200: boolean
|
||||
}
|
||||
|
||||
export type AuthSetResponse = AuthSetResponses[keyof AuthSetResponses]
|
||||
|
||||
export type ProjectListData = {
|
||||
body?: never
|
||||
path?: never
|
||||
|
|
@ -2271,6 +2427,12 @@ export type ProjectUpdateData = {
|
|||
override?: string
|
||||
color?: string
|
||||
}
|
||||
commands?: {
|
||||
/**
|
||||
* Startup script to run when creating a new workspace (worktree)
|
||||
*/
|
||||
start?: string
|
||||
}
|
||||
}
|
||||
path: {
|
||||
projectID: string
|
||||
|
|
@ -3269,7 +3431,7 @@ export type SessionPromptData = {
|
|||
tools?: {
|
||||
[key: string]: boolean
|
||||
}
|
||||
outputFormat?: OutputFormat
|
||||
format?: OutputFormat
|
||||
system?: string
|
||||
variant?: string
|
||||
parts: Array<TextPartInput | FilePartInput | AgentPartInput | SubtaskPartInput>
|
||||
|
|
@ -3457,7 +3619,7 @@ export type SessionPromptAsyncData = {
|
|||
tools?: {
|
||||
[key: string]: boolean
|
||||
}
|
||||
outputFormat?: OutputFormat
|
||||
format?: OutputFormat
|
||||
system?: string
|
||||
variant?: string
|
||||
parts: Array<TextPartInput | FilePartInput | AgentPartInput | SubtaskPartInput>
|
||||
|
|
@ -3907,6 +4069,7 @@ export type ProviderListResponses = {
|
|||
}
|
||||
provider?: {
|
||||
npm: string
|
||||
api: string
|
||||
}
|
||||
variants?: {
|
||||
[key: string]: {
|
||||
|
|
@ -4834,6 +4997,7 @@ export type AppSkillsResponses = {
|
|||
name: string
|
||||
description: string
|
||||
location: string
|
||||
content: string
|
||||
}>
|
||||
}
|
||||
|
||||
|
|
@ -4875,35 +5039,6 @@ export type FormatterStatusResponses = {
|
|||
|
||||
export type FormatterStatusResponse = FormatterStatusResponses[keyof FormatterStatusResponses]
|
||||
|
||||
export type AuthSetData = {
|
||||
body?: Auth
|
||||
path: {
|
||||
providerID: string
|
||||
}
|
||||
query?: {
|
||||
directory?: string
|
||||
}
|
||||
url: "/auth/{providerID}"
|
||||
}
|
||||
|
||||
export type AuthSetErrors = {
|
||||
/**
|
||||
* Bad request
|
||||
*/
|
||||
400: BadRequestError
|
||||
}
|
||||
|
||||
export type AuthSetError = AuthSetErrors[keyof AuthSetErrors]
|
||||
|
||||
export type AuthSetResponses = {
|
||||
/**
|
||||
* Successfully set authentication credentials
|
||||
*/
|
||||
200: boolean
|
||||
}
|
||||
|
||||
export type AuthSetResponse = AuthSetResponses[keyof AuthSetResponses]
|
||||
|
||||
export type EventSubscribeData = {
|
||||
body?: never
|
||||
path?: never
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue