refactor(shared): dedupe protocol schema typing and session/media helpers

This commit is contained in:
Peter Steinberger
2026-03-02 15:39:18 +00:00
parent ee0d7ba6d6
commit 8768487aee
10 changed files with 224 additions and 353 deletions

View File

@@ -1,5 +1,10 @@
export type UpdateAvailable = import("../../../src/infra/update-startup.js").UpdateAvailable;
import type { ConfigUiHints } from "../../../src/shared/config-ui-hints-types.js";
import type {
GatewayAgentRow as SharedGatewayAgentRow,
SessionsListResultBase,
SessionsPatchResultBase,
} from "../../../src/shared/session-types.js";
export type { ConfigUiHints } from "../../../src/shared/config-ui-hints-types.js";
export type ChannelsStatusSnapshot = {
@@ -314,17 +319,7 @@ export type GatewaySessionsDefaults = {
contextTokens: number | null;
};
export type GatewayAgentRow = {
id: string;
name?: string;
identity?: {
name?: string;
theme?: string;
emoji?: string;
avatar?: string;
avatarUrl?: string;
};
};
export type GatewayAgentRow = SharedGatewayAgentRow;
export type AgentsListResult = {
defaultId: string;
@@ -422,27 +417,16 @@ export type GatewaySessionRow = {
contextTokens?: number;
};
export type SessionsListResult = {
ts: number;
path: string;
count: number;
defaults: GatewaySessionsDefaults;
sessions: GatewaySessionRow[];
};
export type SessionsListResult = SessionsListResultBase<GatewaySessionsDefaults, GatewaySessionRow>;
export type SessionsPatchResult = {
ok: true;
path: string;
key: string;
entry: {
sessionId: string;
updatedAt?: number;
thinkingLevel?: string;
verboseLevel?: string;
reasoningLevel?: string;
elevatedLevel?: string;
};
};
export type SessionsPatchResult = SessionsPatchResultBase<{
sessionId: string;
updatedAt?: number;
thinkingLevel?: string;
verboseLevel?: string;
reasoningLevel?: string;
elevatedLevel?: string;
}>;
export type {
CostUsageDailyEntry,