refactor(server): remove redundant null from unknown union types (#693)
This commit is contained in:
@@ -6,8 +6,8 @@ function toolCallItem(params: {
|
||||
callId: string;
|
||||
name: string;
|
||||
status?: "running" | "completed" | "failed" | "canceled";
|
||||
input?: unknown | null;
|
||||
output?: unknown | null;
|
||||
input?: unknown;
|
||||
output?: unknown;
|
||||
error?: unknown;
|
||||
metadata?: Record<string, unknown>;
|
||||
detail?: Extract<AgentTimelineItem, { type: "tool_call" }>["detail"];
|
||||
|
||||
@@ -255,8 +255,8 @@ export type ToolCallDetail =
|
||||
}
|
||||
| {
|
||||
type: "unknown";
|
||||
input: unknown | null;
|
||||
output: unknown | null;
|
||||
input: unknown;
|
||||
output: unknown;
|
||||
};
|
||||
|
||||
interface ToolCallBase {
|
||||
|
||||
@@ -136,7 +136,7 @@ function getLatestCompletedBashCall(events: AgentStreamEvent[]): ToolCallTimelin
|
||||
}
|
||||
|
||||
function getInternalQuery(session: AgentSession): unknown {
|
||||
return (session as AgentSession & { query?: unknown | null }).query ?? null;
|
||||
return (session as AgentSession & { query?: unknown }).query ?? null;
|
||||
}
|
||||
|
||||
async function createSession(params?: {
|
||||
|
||||
@@ -100,7 +100,7 @@ function resolveDetailName(toolKind: ClaudeToolKind, name: string): string {
|
||||
function mapClaudeToolCall(
|
||||
params: MapperParams,
|
||||
status: ClaudeToolCallStatus,
|
||||
error: unknown | null,
|
||||
error: unknown,
|
||||
): ToolCallTimelineItem | null {
|
||||
const parsed = ClaudeRawToolCallSchema.safeParse({ ...params, status, error });
|
||||
if (!parsed.success) {
|
||||
|
||||
@@ -31,10 +31,10 @@ const CodexRolloutToolCallParamsSchema = z
|
||||
interface CodexNormalizedToolCallEnvelope {
|
||||
callId: string;
|
||||
name: string;
|
||||
input?: unknown | null;
|
||||
output?: unknown | null;
|
||||
input?: unknown;
|
||||
output?: unknown;
|
||||
status?: ToolCallTimelineItem["status"];
|
||||
error?: unknown | null;
|
||||
error?: unknown;
|
||||
metadata?: Record<string, unknown>;
|
||||
cwd?: string | null;
|
||||
}
|
||||
|
||||
@@ -201,7 +201,7 @@ interface PiLsToolCall {
|
||||
interface PiUnknownToolCall {
|
||||
kind: "unknown";
|
||||
toolName: string;
|
||||
args: unknown | null;
|
||||
args: unknown;
|
||||
}
|
||||
|
||||
type PiTrackedToolCall =
|
||||
|
||||
@@ -46,7 +46,7 @@ export function statPaseoConfigPath(repoRoot: string): PaseoConfigRevision | nul
|
||||
};
|
||||
}
|
||||
|
||||
export function readPaseoConfigJson(repoRoot: string): unknown | null {
|
||||
export function readPaseoConfigJson(repoRoot: string): unknown {
|
||||
const configPath = resolvePaseoConfigPath(repoRoot);
|
||||
if (!existsSync(configPath)) {
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user