Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
14 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 33 additions & 2 deletions packages/core/src/kilocode/gateway-rpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,34 @@ export const Profile = Schema.Struct({

export type Profile = typeof Profile.Type

// The TUI uses this contract for the account picker after login and for /teams, as v1 uses
// `kilo.profile` and `kilo.organization.set`.
export const ModelEntry = Schema.Struct({
id: Schema.String,
name: Schema.String,
isFree: Schema.Boolean,
recommendedIndex: Schema.optional(Schema.Number),
hasUserByokAvailable: Schema.optional(Schema.Boolean),
mayTrainOnYourPrompts: Schema.optional(Schema.Boolean),
autoRouting: Schema.optional(
Schema.Struct({
models: Schema.Array(Schema.String),
}),
),
terminalBench: Schema.optional(
Schema.Struct({
overallScore: Schema.Number,
avgAttemptCostUsd: Schema.Number,
}),
),
description: Schema.optional(Schema.String),
reasoning: Schema.optional(Schema.Boolean),
family: Schema.optional(Schema.String),
aiSDKProvider: Schema.optional(Schema.String),
})

export type ModelEntry = typeof ModelEntry.Type

// The TUI and IDE clients use this contract for the account picker after login, /teams,
// and Kilo-specific model catalog metadata.
export const Definition = Rpc.define({
id: "kilocode.gateway",
methods: {
Expand All @@ -35,6 +61,11 @@ export const Definition = Rpc.define({
output: portable(Schema.Struct({})),
errors: Failure,
},
models: {
input: portable(Schema.Struct({})),
output: portable(Schema.Array(ModelEntry)),
errors: Failure,
},
},
events: {
organization: { schema: portable(Schema.Struct({ organizationID: OrganizationID })) },
Expand Down
Loading
Loading