File tree Expand file tree Collapse file tree 4 files changed +12
-16
lines changed Expand file tree Collapse file tree 4 files changed +12
-16
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @kilocode/cli " : patch
3+ ---
4+
5+ Fix Wellcome Message regression
Original file line number Diff line number Diff line change 11import type { CliMessage , WelcomeMessageOptions } from "../../types/cli.js"
22import type { ValidationResult } from "../../config/validation.js"
33import { getConfigPath } from "../../config/persistence.js"
4-
5- // Counter to ensure unique IDs even when created in the same millisecond
6- let messageCounter = 0
4+ import { generateMessage } from "./messages.js"
75
86/**
97 * Converts validation errors into user-friendly instructions
@@ -42,14 +40,11 @@ export function createConfigErrorInstructions(validation: ValidationResult): str
4240 * @returns A CliMessage of type "welcome"
4341 */
4442export function createWelcomeMessage ( options ?: WelcomeMessageOptions ) : CliMessage {
45- const timestamp = Date . now ( )
46- const id = `welcome-${ timestamp } -${ messageCounter ++ } `
47-
4843 return {
49- id ,
44+ ... generateMessage ( ) ,
5045 type : "welcome" ,
5146 content : "" , // Content is rendered by WelcomeMessageContent component
52- ts : 0 , // Welcome message should show at the top
47+ ts : 1 , // Welcome message should show at the top
5348 metadata : {
5449 welcomeOptions : options ,
5550 } ,
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import packageJson from "package-json"
22import { Package } from "../constants/package.js"
33import { CliMessage } from "../types/cli.js"
44import semver from "semver"
5+ import { generateMessage } from "../ui/utils/messages.js"
56
67type AutoUpdateStatus = {
78 name : string
@@ -31,11 +32,8 @@ export const getAutoUpdateStatus = async () => {
3132}
3233
3334export const generateUpdateAvailableMessage = ( status : AutoUpdateStatus ) : CliMessage => {
34- const timestamp = Date . now ( )
35-
3635 return {
37- id : `update-notification-${ timestamp } ` ,
38- ts : timestamp ,
36+ ...generateMessage ( ) ,
3937 type : "system" ,
4038 content : `## A new version of Kilo CLI is available!
4139You are using v${ status . currentVersion } , the latest version is v${ status . latestVersion } .
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import { getKiloUrlFromToken } from "@roo-code/types"
22import { logs } from "../services/logs.js"
33import type { KilocodeNotification } from "../state/atoms/notifications.js"
44import type { ProviderConfig } from "../config/types.js"
5+ import { generateMessage } from "../ui/utils/messages.js"
56
67/**
78 * Response from the Kilocode notifications API
@@ -72,17 +73,14 @@ export function supportsNotifications(provider: ProviderConfig): boolean {
7273 * @returns A CLI message object
7374 */
7475export function generateNotificationMessage ( notification : KilocodeNotification ) {
75- const timestamp = Date . now ( )
76-
7776 let content = `## ${ notification . title } \n\n${ notification . message } `
7877
7978 if ( notification . action ) {
8079 content += `\n\n[${ notification . action . actionText } ](${ notification . action . actionURL } )`
8180 }
8281
8382 return {
84- id : `notification-${ notification . id } -${ timestamp } ` ,
85- ts : timestamp ,
83+ ...generateMessage ( ) ,
8684 type : "system" as const ,
8785 content,
8886 }
You can’t perform that action at this time.
0 commit comments