Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions .changeset/some-apes-speak.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"kilo-code": patch
---

Improved Kilo multi-profile support
1 change: 1 addition & 0 deletions packages/types/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export * from "./type-fu.js"
export * from "./vscode.js"
export * from "./kilocode/kilocode.js"
export * from "./kilocode/device-auth.js" // kilocode_change
export * from "./kilocode/kilo-user.js" // kilocode_change
export * from "./kilocode/nativeFunctionCallingProviders.js"
export * from "./usage-tracker.js" // kilocode_change

Expand Down
41 changes: 41 additions & 0 deletions packages/types/src/kilocode/kilo-user.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/**
* KiloUser represents the globally resolved Kilo Code user based on profile priority rules.
* This is used for telemetry identity and authentication status across the extension.
*/
export interface KiloUser {
/**
* Where the user was resolved from based on priority rules:
* - "active-profile": The current active profile is a kilocode provider
* - "other-profile": Found from the first kilocode provider in profiles list
* - "none": No kilocode provider found
*/
source: "active-profile" | "other-profile" | "none"

/**
* The name of the profile the user was resolved from.
* Undefined if source is "none".
*/
profileName: string | undefined

/**
* The user's email address, used for telemetry identity.
* Undefined if not authenticated or if source is "none".
*/
email: string | undefined

/**
* Whether the user is authenticated with a valid Kilo Code account.
* True if we have a valid token and successfully fetched user data.
*/
isAuthenticated: boolean
}

/**
* Default/empty KiloUser state when no kilocode provider is configured
*/
export const EMPTY_KILO_USER: KiloUser = {
source: "none",
profileName: undefined,
email: undefined,
isAuthenticated: false,
}
Loading