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
1 change: 1 addition & 0 deletions cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
"@modelcontextprotocol/sdk": "^1.24.0",
"@qdrant/js-client-rest": "^1.14.0",
"@roo-code/cloud": "workspace:^",
"@kilocode/core-schemas": "workspace:^",
"@roo-code/telemetry": "workspace:^",
"@roo-code/types": "workspace:^",
"@vscode/codicons": "^0.0.36",
Expand Down
85 changes: 30 additions & 55 deletions cli/src/auth/types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
/**
* Authentication Types
*
* Re-exports types from @kilocode/core-schemas for runtime validation
* and backward compatibility with existing code.
*/

import type { ProviderConfig } from "../config/types.js"

// Re-export Kilocode schemas from core-schemas
export { kilocodeOrganizationSchema, kilocodeProfileDataSchema } from "@kilocode/core-schemas"

// Re-export Kilocode types from core-schemas
export type { KilocodeOrganization, KilocodeProfileData } from "@kilocode/core-schemas"

// Device auth (from @roo-code/types via core-schemas)
export {
DeviceAuthInitiateResponseSchema,
DeviceAuthPollResponseSchema,
type DeviceAuthInitiateResponse,
type DeviceAuthPollResponse,
type DeviceAuthState,
} from "@kilocode/core-schemas"

/**
* Result of a successful authentication flow
*/
Expand All @@ -20,50 +42,15 @@ export interface AuthProvider {
}

/**
* Device authorization response from initiate endpoint
*/
export interface DeviceAuthInitiateResponse {
/** Verification code to display to user */
code: string
/** URL for user to visit in browser */
verificationUrl: string
/** Time in seconds until code expires */
expiresIn: number
}

/**
* Device authorization poll response
*/
export interface DeviceAuthPollResponse {
/** Current status of the authorization */
status: "pending" | "approved" | "denied" | "expired"
/** API token (only present when approved) */
token?: string
/** User ID (only present when approved) */
userId?: string
/** User email (only present when approved) */
userEmail?: string
}

/**
* Organization data from Kilocode API
*/
export interface KilocodeOrganization {
id: string
name: string
role: string
}

/**
* Profile data structure from Kilocode API
* Result of a poll operation
*/
export interface KilocodeProfileData {
user?: {
name?: string
email?: string
image?: string
}
organizations?: KilocodeOrganization[]
export interface PollResult {
/** Whether polling should continue */
continue: boolean
/** Optional data returned when polling completes */
data?: unknown
/** Optional error if polling failed */
error?: Error
}

/**
Expand All @@ -79,15 +66,3 @@ export interface PollingOptions {
/** Optional callback for progress updates */
onProgress?: (attempt: number, maxAttempts: number) => void
}

/**
* Result of a poll operation
*/
export interface PollResult {
/** Whether polling should continue */
continue: boolean
/** Optional data returned when polling completes */
data?: unknown
/** Optional error if polling failed */
error?: Error
}
Loading