示例工程 63-sessions-search-and-ship
63-sessions-search-and-ship/app/.tsc/shared/sessions.d.ts
export type SeedMessage = {
role: "user" | "assistant";
text: string;
at: number;
};
export type SessionSeed = {
id: string;
title: string;
tags: string[];
createdAt: number;
messages: SeedMessage[];
};
export type SessionRow = {
id: string;
title: string;
tags: string[];
createdAt: number;
updatedAt: number;
messageCount: number;
};
export type SearchHit = {
sessionId: string;
title: string;
score: number;
snippet: string;
matchedIn: "title" | "tag" | "message";
};
export type SessionExport = {
version: 1;
exportedAt: number;
sessions: SessionSeed[];
};
export type FeedFile = {
url: string;
sha256: string;
size: number;
};
export type Feed = {
version: string;
files: FeedFile[];
};
export type FeedResult = {
ok: boolean;
decision: "update" | "none" | "error";
reasons: string[];
target: string;
};
export type ChecklistItem = {
id: string;
label: string;
pass: boolean;
detail: string;
};
export declare const SEED: SessionSeed[];
export declare function seedRows(): SessionRow[];
export declare function searchSessions(sessions: SessionSeed[], query: string): SearchHit[];
export declare const FEED: Feed;
export declare const CURRENT_VERSION = "1.0.0";
export declare function validateFeed(feed: Feed, current?: string): FeedResult;
export declare function isSessionExport(value: unknown): value is SessionExport;
export declare function buildChecklist(facts: {
exportExists: boolean;
importSessions: number;
importMessages: number;
hits: number;
feed: FeedResult;
}): ChecklistItem[];
//# sourceMappingURL=sessions.d.ts.map