mirror of
https://github.com/Kilo-Org/kilocode.git
synced 2026-09-24 16:02:55 +08:00
refactor(sdk): reorder generated types and fix route chaining in instance handler
Alphabetically sort import statements in the SDK codegen output and reposition type declarations (EventInstallationUpdated, EventSessionTurnOpen, SessionStatus, Todo, etc.) to match updated code generation ordering. In the server instance router, assign the chained route builder to a `full` variable before passing it to `registerKiloRoutes` for clarity.
This commit is contained in:
@@ -50,7 +50,7 @@ export const InstanceRoutes = (upgrade: UpgradeWebSocket): Hono => {
|
||||
.all("/provider/auth", (c) => handler(c.req.raw))
|
||||
}
|
||||
|
||||
return app
|
||||
const full = app // kilocode_change
|
||||
.route("/question", QuestionRoutes())
|
||||
.route("/provider", ProviderRoutes())
|
||||
.route("/sync", SyncRoutes())
|
||||
@@ -299,5 +299,5 @@ export const InstanceRoutes = (upgrade: UpgradeWebSocket): Hono => {
|
||||
},
|
||||
)
|
||||
|
||||
return registerKiloRoutes(app) // kilocode_change
|
||||
return registerKiloRoutes(full) // kilocode_change
|
||||
}
|
||||
|
||||
@@ -213,12 +213,12 @@ import type {
|
||||
SuggestionDismissErrors,
|
||||
SuggestionDismissResponses,
|
||||
SuggestionListResponses,
|
||||
TelemetryCaptureErrors,
|
||||
TelemetryCaptureResponses,
|
||||
SyncHistoryListErrors,
|
||||
SyncHistoryListResponses,
|
||||
SyncReplayErrors,
|
||||
SyncReplayResponses,
|
||||
TelemetryCaptureErrors,
|
||||
TelemetryCaptureResponses,
|
||||
TextPartInput,
|
||||
ToolIdsErrors,
|
||||
ToolIdsResponses,
|
||||
|
||||
@@ -91,6 +91,20 @@ export type EventLspUpdated = {
|
||||
}
|
||||
}
|
||||
|
||||
export type EventInstallationUpdated = {
|
||||
type: "installation.updated"
|
||||
properties: {
|
||||
version: string
|
||||
}
|
||||
}
|
||||
|
||||
export type EventInstallationUpdateAvailable = {
|
||||
type: "installation.update-available"
|
||||
properties: {
|
||||
version: string
|
||||
}
|
||||
}
|
||||
|
||||
export type EventTuiPromptAppend = {
|
||||
type: "tui.prompt.append"
|
||||
properties: {
|
||||
@@ -199,20 +213,6 @@ export type EventSessionNetworkRestored = {
|
||||
}
|
||||
}
|
||||
|
||||
export type EventInstallationUpdated = {
|
||||
type: "installation.updated"
|
||||
properties: {
|
||||
version: string
|
||||
}
|
||||
}
|
||||
|
||||
export type EventInstallationUpdateAvailable = {
|
||||
type: "installation.update-available"
|
||||
properties: {
|
||||
version: string
|
||||
}
|
||||
}
|
||||
|
||||
export type EventMessagePartDelta = {
|
||||
type: "message.part.delta"
|
||||
properties: {
|
||||
@@ -224,21 +224,6 @@ export type EventMessagePartDelta = {
|
||||
}
|
||||
}
|
||||
|
||||
export type EventSessionTurnOpen = {
|
||||
type: "session.turn.open"
|
||||
properties: {
|
||||
sessionID: string
|
||||
}
|
||||
}
|
||||
|
||||
export type EventSessionTurnClose = {
|
||||
type: "session.turn.close"
|
||||
properties: {
|
||||
sessionID: string
|
||||
reason: "completed" | "error" | "interrupted"
|
||||
}
|
||||
}
|
||||
|
||||
export type PermissionRequest = {
|
||||
id: string
|
||||
sessionID: string
|
||||
@@ -268,6 +253,21 @@ export type EventPermissionReplied = {
|
||||
}
|
||||
}
|
||||
|
||||
export type EventSessionTurnOpen = {
|
||||
type: "session.turn.open"
|
||||
properties: {
|
||||
sessionID: string
|
||||
}
|
||||
}
|
||||
|
||||
export type EventSessionTurnClose = {
|
||||
type: "session.turn.close"
|
||||
properties: {
|
||||
sessionID: string
|
||||
reason: "completed" | "error" | "interrupted"
|
||||
}
|
||||
}
|
||||
|
||||
export type SnapshotFileDiff = {
|
||||
file: string
|
||||
patch: string
|
||||
@@ -441,60 +441,13 @@ export type EventQuestionRejected = {
|
||||
properties: QuestionRejected
|
||||
}
|
||||
|
||||
export type Todo = {
|
||||
/**
|
||||
* Brief description of the task
|
||||
*/
|
||||
content: string
|
||||
/**
|
||||
* Current status of the task: pending, in_progress, completed, cancelled
|
||||
*/
|
||||
status: string
|
||||
/**
|
||||
* Priority level of the task: high, medium, low
|
||||
*/
|
||||
priority: string
|
||||
}
|
||||
|
||||
export type EventTodoUpdated = {
|
||||
type: "todo.updated"
|
||||
properties: {
|
||||
sessionID: string
|
||||
todos: Array<Todo>
|
||||
}
|
||||
}
|
||||
|
||||
export type SessionStatus =
|
||||
| {
|
||||
type: "idle"
|
||||
}
|
||||
| {
|
||||
type: "retry"
|
||||
attempt: number
|
||||
message: string
|
||||
next: number
|
||||
}
|
||||
| {
|
||||
type: "busy"
|
||||
}
|
||||
| {
|
||||
type: "offline"
|
||||
requestID: string
|
||||
message: string
|
||||
}
|
||||
|
||||
export type EventSessionStatus = {
|
||||
type: "session.status"
|
||||
properties: {
|
||||
sessionID: string
|
||||
status: SessionStatus
|
||||
}
|
||||
}
|
||||
|
||||
export type EventSessionIdle = {
|
||||
type: "session.idle"
|
||||
export type EventCommandExecuted = {
|
||||
type: "command.executed"
|
||||
properties: {
|
||||
name: string
|
||||
sessionID: string
|
||||
arguments: string
|
||||
messageID: string
|
||||
}
|
||||
}
|
||||
|
||||
@@ -557,20 +510,60 @@ export type EventSuggestionDismissed = {
|
||||
}
|
||||
}
|
||||
|
||||
export type EventSessionCompacted = {
|
||||
type: "session.compacted"
|
||||
export type SessionStatus =
|
||||
| {
|
||||
type: "idle"
|
||||
}
|
||||
| {
|
||||
type: "retry"
|
||||
attempt: number
|
||||
message: string
|
||||
next: number
|
||||
}
|
||||
| {
|
||||
type: "busy"
|
||||
}
|
||||
| {
|
||||
type: "offline"
|
||||
requestID: string
|
||||
message: string
|
||||
}
|
||||
|
||||
export type EventSessionStatus = {
|
||||
type: "session.status"
|
||||
properties: {
|
||||
sessionID: string
|
||||
status: SessionStatus
|
||||
}
|
||||
}
|
||||
|
||||
export type EventSessionIdle = {
|
||||
type: "session.idle"
|
||||
properties: {
|
||||
sessionID: string
|
||||
}
|
||||
}
|
||||
|
||||
export type EventCommandExecuted = {
|
||||
type: "command.executed"
|
||||
export type Todo = {
|
||||
/**
|
||||
* Brief description of the task
|
||||
*/
|
||||
content: string
|
||||
/**
|
||||
* Current status of the task: pending, in_progress, completed, cancelled
|
||||
*/
|
||||
status: string
|
||||
/**
|
||||
* Priority level of the task: high, medium, low
|
||||
*/
|
||||
priority: string
|
||||
}
|
||||
|
||||
export type EventTodoUpdated = {
|
||||
type: "todo.updated"
|
||||
properties: {
|
||||
name: string
|
||||
sessionID: string
|
||||
arguments: string
|
||||
messageID: string
|
||||
todos: Array<Todo>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -581,6 +574,13 @@ export type EventVcsBranchUpdated = {
|
||||
}
|
||||
}
|
||||
|
||||
export type EventSessionCompacted = {
|
||||
type: "session.compacted"
|
||||
properties: {
|
||||
sessionID: string
|
||||
}
|
||||
}
|
||||
|
||||
export type EventKiloSessionsRemoteStatusChanged = {
|
||||
type: "kilo-sessions.remote-status-changed"
|
||||
properties: {
|
||||
@@ -1271,6 +1271,8 @@ export type GlobalEvent = {
|
||||
| EventFileWatcherUpdated
|
||||
| EventLspClientDiagnostics
|
||||
| EventLspUpdated
|
||||
| EventInstallationUpdated
|
||||
| EventInstallationUpdateAvailable
|
||||
| EventTuiPromptAppend
|
||||
| EventTuiCommandExecute
|
||||
| EventTuiToastShow
|
||||
@@ -1281,27 +1283,25 @@ export type GlobalEvent = {
|
||||
| EventSessionNetworkReplied
|
||||
| EventSessionNetworkRejected
|
||||
| EventSessionNetworkRestored
|
||||
| EventInstallationUpdated
|
||||
| EventInstallationUpdateAvailable
|
||||
| EventMessagePartDelta
|
||||
| EventSessionTurnOpen
|
||||
| EventSessionTurnClose
|
||||
| EventPermissionAsked
|
||||
| EventPermissionReplied
|
||||
| EventSessionTurnOpen
|
||||
| EventSessionTurnClose
|
||||
| EventSessionDiff
|
||||
| EventSessionError
|
||||
| EventQuestionAsked
|
||||
| EventQuestionReplied
|
||||
| EventQuestionRejected
|
||||
| EventTodoUpdated
|
||||
| EventSessionStatus
|
||||
| EventSessionIdle
|
||||
| EventCommandExecuted
|
||||
| EventSuggestionShown
|
||||
| EventSuggestionAccepted
|
||||
| EventSuggestionDismissed
|
||||
| EventSessionCompacted
|
||||
| EventCommandExecuted
|
||||
| EventSessionStatus
|
||||
| EventSessionIdle
|
||||
| EventTodoUpdated
|
||||
| EventVcsBranchUpdated
|
||||
| EventSessionCompacted
|
||||
| EventKiloSessionsRemoteStatusChanged
|
||||
| EventWorktreeReady
|
||||
| EventWorktreeFailed
|
||||
@@ -1548,9 +1548,9 @@ export type ProviderConfig = {
|
||||
*/
|
||||
disabled?: boolean
|
||||
[key: string]: unknown | boolean | undefined
|
||||
}
|
||||
} | null
|
||||
}
|
||||
}
|
||||
} | null
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2241,6 +2241,8 @@ export type Event =
|
||||
| EventFileWatcherUpdated
|
||||
| EventLspClientDiagnostics
|
||||
| EventLspUpdated
|
||||
| EventInstallationUpdated
|
||||
| EventInstallationUpdateAvailable
|
||||
| EventTuiPromptAppend
|
||||
| EventTuiCommandExecute
|
||||
| EventTuiToastShow
|
||||
@@ -2251,27 +2253,25 @@ export type Event =
|
||||
| EventSessionNetworkReplied
|
||||
| EventSessionNetworkRejected
|
||||
| EventSessionNetworkRestored
|
||||
| EventInstallationUpdated
|
||||
| EventInstallationUpdateAvailable
|
||||
| EventMessagePartDelta
|
||||
| EventSessionTurnOpen
|
||||
| EventSessionTurnClose
|
||||
| EventPermissionAsked
|
||||
| EventPermissionReplied
|
||||
| EventSessionTurnOpen
|
||||
| EventSessionTurnClose
|
||||
| EventSessionDiff
|
||||
| EventSessionError
|
||||
| EventQuestionAsked
|
||||
| EventQuestionReplied
|
||||
| EventQuestionRejected
|
||||
| EventTodoUpdated
|
||||
| EventSessionStatus
|
||||
| EventSessionIdle
|
||||
| EventCommandExecuted
|
||||
| EventSuggestionShown
|
||||
| EventSuggestionAccepted
|
||||
| EventSuggestionDismissed
|
||||
| EventSessionCompacted
|
||||
| EventCommandExecuted
|
||||
| EventSessionStatus
|
||||
| EventSessionIdle
|
||||
| EventTodoUpdated
|
||||
| EventVcsBranchUpdated
|
||||
| EventSessionCompacted
|
||||
| EventKiloSessionsRemoteStatusChanged
|
||||
| EventWorktreeReady
|
||||
| EventWorktreeFailed
|
||||
|
||||
Reference in New Issue
Block a user