Skip to content

Commit 0ecfc52

Browse files
authored
refactor(ui): trim unused type surface (#100952)
Fixes #100951
1 parent fbf574a commit 0ecfc52

13 files changed

Lines changed: 28 additions & 64 deletions

File tree

ui/src/api/types.ts

Lines changed: 16 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ export type WhatsAppStatus = {
100100
lastError?: string | null;
101101
};
102102

103-
export type TelegramBot = {
103+
type TelegramBot = {
104104
id?: number | null;
105105
username?: string | null;
106106
};
@@ -110,7 +110,7 @@ type TelegramWebhook = {
110110
hasCustomCert?: boolean | null;
111111
};
112112

113-
export type TelegramProbe = {
113+
type TelegramProbe = {
114114
ok: boolean;
115115
status?: number | null;
116116
error?: string | null;
@@ -136,7 +136,7 @@ type DiscordBot = {
136136
username?: string | null;
137137
};
138138

139-
export type DiscordProbe = {
139+
type DiscordProbe = {
140140
ok: boolean;
141141
status?: number | null;
142142
error?: string | null;
@@ -187,7 +187,7 @@ type SlackTeam = {
187187
name?: string | null;
188188
};
189189

190-
export type SlackProbe = {
190+
type SlackProbe = {
191191
ok: boolean;
192192
status?: number | null;
193193
error?: string | null;
@@ -208,7 +208,7 @@ export type SlackStatus = {
208208
lastProbeAt?: number | null;
209209
};
210210

211-
export type SignalProbe = {
211+
type SignalProbe = {
212212
ok: boolean;
213213
status?: number | null;
214214
error?: string | null;
@@ -227,7 +227,7 @@ export type SignalStatus = {
227227
lastProbeAt?: number | null;
228228
};
229229

230-
export type IMessageProbe = {
230+
type IMessageProbe = {
231231
ok: boolean;
232232
error?: string | null;
233233
};
@@ -430,9 +430,9 @@ export type ArtifactDownloadResult = {
430430
};
431431

432432
export type SessionRunStatus = "running" | "done" | "failed" | "killed" | "timeout";
433-
export type SubagentRunState = "active" | "interrupted" | "historical";
433+
type SubagentRunState = "active" | "interrupted" | "historical";
434434

435-
export type SessionCompactionCheckpointReason =
435+
type SessionCompactionCheckpointReason =
436436
| "manual"
437437
| "auto-threshold"
438438
| "overflow-retry"
@@ -459,7 +459,7 @@ export type SessionCompactionCheckpoint = {
459459
postCompaction: SessionCompactionTranscriptReference;
460460
};
461461

462-
export type SessionCompactionCheckpointPreview = Pick<
462+
type SessionCompactionCheckpointPreview = Pick<
463463
SessionCompactionCheckpoint,
464464
"checkpointId" | "createdAt" | "reason"
465465
>;
@@ -531,12 +531,6 @@ export type SessionsCompactionListResult = {
531531
checkpoints: SessionCompactionCheckpoint[];
532532
};
533533

534-
export type SessionsCompactionGetResult = {
535-
ok: true;
536-
key: string;
537-
checkpoint: SessionCompactionCheckpoint;
538-
};
539-
540534
export type SessionsCompactionBranchResult = {
541535
ok: true;
542536
sourceKey: string;
@@ -595,14 +589,14 @@ export type CronRunsStatusValue = CronRunStatus;
595589
export type CronRunsStatusFilter = "all" | CronRunStatus;
596590
export type CronSortDir = "asc" | "desc";
597591

598-
export type CronSchedule =
592+
type CronSchedule =
599593
| { kind: "at"; at: string }
600594
| { kind: "every"; everyMs: number; anchorMs?: number }
601595
| { kind: "cron"; expr: string; tz?: string; staggerMs?: number }
602596
| { kind: "on-exit"; command: string; cwd?: string };
603597

604-
export type CronSessionTarget = "main" | "isolated" | "current" | `session:${string}`;
605-
export type CronWakeMode = "next-heartbeat" | "now";
598+
type CronSessionTarget = "main" | "isolated" | "current" | `session:${string}`;
599+
type CronWakeMode = "next-heartbeat" | "now";
606600

607601
export type CronPayload =
608602
| { kind: "systemEvent"; text: string }
@@ -640,14 +634,14 @@ export type CronDelivery = {
640634
failureDestination?: CronFailureDestination;
641635
};
642636

643-
export type CronFailureDestination = {
637+
type CronFailureDestination = {
644638
channel?: string;
645639
to?: string;
646640
mode?: "announce" | "webhook";
647641
accountId?: string;
648642
};
649643

650-
export type CronFailureAlert = {
644+
type CronFailureAlert = {
651645
after?: number;
652646
channel?: string;
653647
to?: string;
@@ -656,7 +650,7 @@ export type CronFailureAlert = {
656650
accountId?: string;
657651
};
658652

659-
export type CronJobState = {
653+
type CronJobState = {
660654
nextRunAtMs?: number;
661655
runningAtMs?: number;
662656
lastRunAtMs?: number;
@@ -742,7 +736,7 @@ type SkillsStatusConfigCheck = {
742736
satisfied: boolean;
743737
};
744738

745-
export type SkillInstallOption = {
739+
type SkillInstallOption = {
746740
id: string;
747741
kind: "brew" | "node" | "go" | "uv" | "download";
748742
label: string;
@@ -828,25 +822,6 @@ export type StatusSummary = Record<string, unknown>;
828822

829823
export type HealthSnapshot = Record<string, unknown>;
830824

831-
/** Strongly-typed health response from the gateway (richer than HealthSnapshot). */
832-
export type HealthSummary = {
833-
ok: boolean;
834-
ts: number;
835-
durationMs: number;
836-
heartbeatSeconds: number;
837-
defaultAgentId: string;
838-
agents: Array<{ id: string; name?: string }>;
839-
sessions: {
840-
path: string;
841-
count: number;
842-
recent: Array<{
843-
key: string;
844-
updatedAt: number | null;
845-
age: number | null;
846-
}>;
847-
};
848-
};
849-
850825
/** A model entry returned by the gateway model-catalog endpoint. */
851826
export type ModelCatalogEntry = {
852827
id: string;
@@ -860,23 +835,13 @@ export type ModelCatalogEntry = {
860835

861836
export type ToolCatalogProfile =
862837
import("../../../packages/gateway-protocol/src/schema.js").ToolCatalogProfile;
863-
export type ToolCatalogEntry =
864-
import("../../../packages/gateway-protocol/src/schema.js").ToolCatalogEntry;
865-
export type ToolCatalogGroup =
866-
import("../../../packages/gateway-protocol/src/schema.js").ToolCatalogGroup;
867838
export type ToolsCatalogResult =
868839
import("../../../packages/gateway-protocol/src/schema.js").ToolsCatalogResult;
869840
export type ToolsEffectiveEntry =
870841
import("../../../packages/gateway-protocol/src/schema.js").ToolsEffectiveEntry;
871-
export type ToolsEffectiveGroup =
872-
import("../../../packages/gateway-protocol/src/schema.js").ToolsEffectiveGroup;
873842
export type ToolsEffectiveResult =
874843
import("../../../packages/gateway-protocol/src/schema.js").ToolsEffectiveResult;
875844

876-
export type ModelAuthExpiry =
877-
import("../../../src/gateway/server-methods/models-auth-status.js").ModelAuthExpiry;
878-
export type ModelAuthStatusProfile =
879-
import("../../../src/gateway/server-methods/models-auth-status.js").ModelAuthStatusProfile;
880845
export type ModelAuthStatusProvider =
881846
import("../../../src/gateway/server-methods/models-auth-status.js").ModelAuthStatusProvider;
882847
export type ModelAuthStatusResult =

ui/src/app/exec-approval.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export type ExecApprovalRequest = {
3131
expiresAtMs: number;
3232
};
3333

34-
export type ExecApprovalResolved = {
34+
type ExecApprovalResolved = {
3535
id: string;
3636
decision?: string | null;
3737
resolvedBy?: string | null;

ui/src/lib/chat/commands.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,7 @@ export function getHiddenCommandCount(): number {
487487
return SLASH_COMMANDS.filter((cmd) => (cmd.tier ?? "standard") === "power").length;
488488
}
489489

490-
export type ParsedSlashCommand = {
490+
type ParsedSlashCommand = {
491491
command: SlashCommandDef;
492492
args: string;
493493
};

ui/src/lib/config/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ export async function applyConfig(state: ConfigState): Promise<boolean> {
492492
});
493493
}
494494

495-
export async function patchConfig(
495+
async function patchConfig(
496496
state: ConfigGatewayState,
497497
options: ConfigPatchOptions,
498498
): Promise<boolean> {

ui/src/lib/cron/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ function isRecord(value: unknown): value is Record<string, unknown> {
7272
return Boolean(value && typeof value === "object");
7373
}
7474

75-
export function isCronPayload(value: unknown): value is CronPayload {
75+
function isCronPayload(value: unknown): value is CronPayload {
7676
if (!isRecord(value)) {
7777
return false;
7878
}

ui/src/lib/nodes/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export type ExecApprovalsAllowlistEntry = {
7676
lastResolvedPath?: string;
7777
};
7878

79-
export type ExecApprovalsAgent = ExecApprovalsDefaults & {
79+
type ExecApprovalsAgent = ExecApprovalsDefaults & {
8080
allowlist?: ExecApprovalsAllowlistEntry[];
8181
};
8282

ui/src/lib/select-options.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Control UI module implements select options behavior.
22
import { normalizeLowercaseStringOrEmpty } from "./string-coerce.ts";
33

4-
export type SelectOption = {
4+
type SelectOption = {
55
value: string;
66
label: string;
77
};

ui/src/lib/session-display.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function capitalize(s: string): string {
3636
* Parse a session key to extract type information and a human-readable
3737
* fallback display name. Exported for testing.
3838
*/
39-
export function parseSessionKey(key: string): SessionKeyInfo {
39+
function parseSessionKey(key: string): SessionKeyInfo {
4040
const normalized = normalizeLowercaseStringOrEmpty(key);
4141

4242
// Main session.

ui/src/lib/sessions/session-key.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
normalizeOptionalString,
66
} from "../string-coerce.ts";
77

8-
export type ParsedAgentSessionKey = {
8+
type ParsedAgentSessionKey = {
99
agentId: string;
1010
rest: string;
1111
};

ui/src/lib/string-coerce.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ export {
33
normalizeLowercaseStringOrEmpty,
44
normalizeOptionalLowercaseString,
55
normalizeOptionalString,
6-
normalizeStringifiedOptionalString,
76
} from "@openclaw/normalization-core/string-coerce";
87
export {
98
normalizeStringEntries,

0 commit comments

Comments
 (0)