better chat ui
This commit is contained in:
+622
-297
File diff suppressed because it is too large
Load Diff
@@ -152,3 +152,92 @@ export type ModelInfo = {
|
||||
reasoning?: boolean;
|
||||
images?: boolean;
|
||||
};
|
||||
|
||||
// ── Pi-native JSONL types ──────────────────────────────────────────────
|
||||
|
||||
export type JnlSessionHeader = {
|
||||
type: 'session';
|
||||
version: 3;
|
||||
id: string;
|
||||
timestamp: string;
|
||||
cwd: string;
|
||||
};
|
||||
|
||||
export type JnlEntryBase = {
|
||||
type: string;
|
||||
id: string;
|
||||
parentId?: string;
|
||||
timestamp: string;
|
||||
};
|
||||
|
||||
export type JnlTextContent = {
|
||||
type: 'text';
|
||||
text: string;
|
||||
};
|
||||
|
||||
export type JnlToolCall = {
|
||||
type: 'tool_use';
|
||||
id: string;
|
||||
name: string;
|
||||
input: Record<string, unknown>;
|
||||
};
|
||||
|
||||
export type JnlUserMessage = JnlEntryBase & {
|
||||
type: 'message';
|
||||
message: {
|
||||
role: 'user';
|
||||
content: string;
|
||||
};
|
||||
};
|
||||
|
||||
export type JnlAssistantMessage = JnlEntryBase & {
|
||||
type: 'message';
|
||||
message: {
|
||||
role: 'assistant';
|
||||
content: Array<JnlTextContent | JnlToolCall>;
|
||||
};
|
||||
};
|
||||
|
||||
export type JnlToolResultMessage = JnlEntryBase & {
|
||||
type: 'message';
|
||||
message: {
|
||||
role: 'toolResult';
|
||||
toolCallId: string;
|
||||
toolName: string;
|
||||
content: Array<JnlTextContent>;
|
||||
isError?: boolean;
|
||||
};
|
||||
};
|
||||
|
||||
export type JnlMessageEntry = JnlUserMessage | JnlAssistantMessage | JnlToolResultMessage;
|
||||
|
||||
export type JnlSessionInfoEntry = JnlEntryBase & {
|
||||
type: 'session_info';
|
||||
name: string;
|
||||
officer?: {
|
||||
cost: MessageCost;
|
||||
model: string;
|
||||
groupSlug?: string | null;
|
||||
messageCount: number;
|
||||
createdAt: number;
|
||||
updatedAt: number;
|
||||
};
|
||||
};
|
||||
|
||||
export type JnlEntry = JnlMessageEntry | JnlSessionInfoEntry;
|
||||
|
||||
// ── Session Index ──────────────────────────────────────────────────────
|
||||
|
||||
export type SessionIndexEntry = {
|
||||
file: string;
|
||||
title: string;
|
||||
model: string;
|
||||
cwd: string;
|
||||
createdAt: number;
|
||||
updatedAt: number;
|
||||
messageCount: number;
|
||||
cost: MessageCost;
|
||||
groupSlug?: string | null;
|
||||
};
|
||||
|
||||
export type SessionIndex = Record<string, SessionIndexEntry>;
|
||||
|
||||
Reference in New Issue
Block a user