feat: Add Welcome Back Dialog, Project Summary, and Enhanced Quit Options (#553)

This commit is contained in:
pomelo
2025-09-11 16:59:26 +08:00
committed by GitHub
parent 03eb1faf0a
commit b1a1ce530e
28 changed files with 1322 additions and 24 deletions

View File

@@ -7,6 +7,33 @@
import { formatDuration } from '../utils/formatters.js';
import { CommandKind, type SlashCommand } from './types.js';
export const quitConfirmCommand: SlashCommand = {
name: 'quit-confirm',
description: 'Show quit confirmation dialog',
kind: CommandKind.BUILT_IN,
action: (context) => {
const now = Date.now();
const { sessionStartTime } = context.session.stats;
const wallDuration = now - sessionStartTime.getTime();
return {
type: 'quit_confirmation',
messages: [
{
type: 'user',
text: `/quit-confirm`,
id: now - 1,
},
{
type: 'quit_confirmation',
duration: formatDuration(wallDuration),
id: now,
},
],
};
},
};
export const quitCommand: SlashCommand = {
name: 'quit',
altNames: ['exit'],