Files
openclaw/src/tui/tui-types.ts
Nimrod Gutman 9aac55d306 Add /btw side questions (#45444)
* feat(agent): add /btw side questions

* fix(agent): gate and log /btw reviews

* feat(btw): isolate side-question delivery

* test(reply): update route reply runtime mocks

* fix(btw): complete side-result delivery across clients

* fix(gateway): handle streamed btw side results

* fix(telegram): unblock btw side questions

* fix(reply): make external btw replies explicit

* fix(chat): keep btw side results ephemeral in internal history

* fix(btw): address remaining review feedback

* fix(chat): preserve btw history on mobile refresh

* fix(acp): keep btw replies out of prompt history

* refactor(btw): narrow side questions to live channels

* fix(btw): preserve channel typing indicators

* fix(btw): keep side questions isolated in chat

* fix(outbound): restore typed channel send deps

* fix(btw): avoid blocking replies on transcript persistence

* fix(btw): keep side questions fast

* docs(commands): document btw slash command

* docs(changelog): add btw side questions entry

* test(outbound): align session transcript mocks
2026-03-14 17:27:54 +02:00

123 lines
2.7 KiB
TypeScript

export type TuiOptions = {
url?: string;
token?: string;
password?: string;
session?: string;
deliver?: boolean;
thinking?: string;
timeoutMs?: number;
historyLimit?: number;
message?: string;
};
export type ChatEvent = {
runId: string;
sessionKey: string;
state: "delta" | "final" | "aborted" | "error";
message?: unknown;
errorMessage?: string;
};
export type BtwEvent = {
kind: "btw";
runId?: string;
sessionKey?: string;
question: string;
text: string;
isError?: boolean;
seq?: number;
ts?: number;
};
export type AgentEvent = {
runId: string;
stream: string;
data?: Record<string, unknown>;
};
export type ResponseUsageMode = "on" | "off" | "tokens" | "full";
export type SessionInfo = {
thinkingLevel?: string;
fastMode?: boolean;
verboseLevel?: string;
reasoningLevel?: string;
model?: string;
modelProvider?: string;
contextTokens?: number | null;
inputTokens?: number | null;
outputTokens?: number | null;
totalTokens?: number | null;
responseUsage?: ResponseUsageMode;
updatedAt?: number | null;
displayName?: string;
};
export type SessionScope = "per-sender" | "global";
export type AgentSummary = {
id: string;
name?: string;
};
export type GatewayStatusSummary = {
runtimeVersion?: string | null;
linkChannel?: {
id?: string;
label?: string;
linked?: boolean;
authAgeMs?: number | null;
};
heartbeat?: {
defaultAgentId?: string;
agents?: Array<{
agentId?: string;
enabled?: boolean;
every?: string;
everyMs?: number | null;
}>;
};
providerSummary?: string[];
queuedSystemEvents?: string[];
sessions?: {
paths?: string[];
count?: number;
defaults?: { model?: string | null; contextTokens?: number | null };
recent?: Array<{
agentId?: string;
key: string;
kind?: string;
updatedAt?: number | null;
age?: number | null;
model?: string | null;
totalTokens?: number | null;
contextTokens?: number | null;
remainingTokens?: number | null;
percentUsed?: number | null;
flags?: string[];
}>;
};
};
export type TuiStateAccess = {
agentDefaultId: string;
sessionMainKey: string;
sessionScope: SessionScope;
agents: AgentSummary[];
currentAgentId: string;
currentSessionKey: string;
currentSessionId: string | null;
activeChatRunId: string | null;
historyLoaded: boolean;
sessionInfo: SessionInfo;
initialSessionApplied: boolean;
isConnected: boolean;
autoMessageSent: boolean;
toolsExpanded: boolean;
showThinking: boolean;
connectionStatus: string;
activityStatus: string;
statusTimeout: ReturnType<typeof setTimeout> | null;
lastCtrlCAt: number;
};