mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 18:40:44 +00:00
refactor: trim gateway session type exports
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
export type GatewayBroadcastStateVersion = {
|
||||
type GatewayBroadcastStateVersion = {
|
||||
presence?: number;
|
||||
health?: number;
|
||||
};
|
||||
|
||||
@@ -12,18 +12,18 @@ type SessionHistoryTranscriptMeta = {
|
||||
seq?: number;
|
||||
};
|
||||
|
||||
export type SessionHistoryMessage = Record<string, unknown> & {
|
||||
type SessionHistoryMessage = Record<string, unknown> & {
|
||||
__openclaw?: SessionHistoryTranscriptMeta;
|
||||
};
|
||||
|
||||
export type PaginatedSessionHistory = {
|
||||
type PaginatedSessionHistory = {
|
||||
items: SessionHistoryMessage[];
|
||||
messages: SessionHistoryMessage[];
|
||||
nextCursor?: string;
|
||||
hasMore: boolean;
|
||||
};
|
||||
|
||||
export type SessionHistorySnapshot = {
|
||||
type SessionHistorySnapshot = {
|
||||
history: PaginatedSessionHistory;
|
||||
rawTranscriptSeq: number;
|
||||
};
|
||||
|
||||
@@ -25,7 +25,7 @@ type PersistedLifecycleSessionShape = Pick<
|
||||
"updatedAt" | "status" | "startedAt" | "endedAt" | "runtimeMs" | "abortedLastRun"
|
||||
>;
|
||||
|
||||
export type GatewaySessionLifecycleSnapshot = Partial<LifecycleSessionShape>;
|
||||
type GatewaySessionLifecycleSnapshot = Partial<LifecycleSessionShape>;
|
||||
|
||||
function isFiniteTimestamp(value: unknown): value is number {
|
||||
return typeof value === "number" && Number.isFinite(value) && value > 0;
|
||||
|
||||
@@ -13,7 +13,7 @@ import {
|
||||
} from "../config/sessions/paths.js";
|
||||
import { resolveRequiredHomeDir } from "../infra/home-dir.js";
|
||||
|
||||
export type ArchiveFileReason = SessionArchiveReason;
|
||||
type ArchiveFileReason = SessionArchiveReason;
|
||||
export type ArchivedSessionTranscript = {
|
||||
sourcePath: string;
|
||||
archivedPath: string;
|
||||
|
||||
@@ -169,13 +169,13 @@ export function readSessionMessages(
|
||||
return messages;
|
||||
}
|
||||
|
||||
export type ReadRecentSessionMessagesOptions = {
|
||||
type ReadRecentSessionMessagesOptions = {
|
||||
maxMessages: number;
|
||||
maxBytes?: number;
|
||||
maxLines?: number;
|
||||
};
|
||||
|
||||
export type ReadRecentSessionMessagesResult = {
|
||||
type ReadRecentSessionMessagesResult = {
|
||||
messages: unknown[];
|
||||
totalMessages: number;
|
||||
};
|
||||
@@ -746,7 +746,7 @@ export function readLastMessagePreviewFromTranscript(
|
||||
});
|
||||
}
|
||||
|
||||
export type SessionTranscriptUsageSnapshot = {
|
||||
type SessionTranscriptUsageSnapshot = {
|
||||
modelProvider?: string;
|
||||
model?: string;
|
||||
inputTokens?: number;
|
||||
|
||||
Reference in New Issue
Block a user