Skip to content

Commit 6775611

Browse files
committed
refactor(gateway): type inline tool auth helpers
1 parent 9e41b2f commit 6775611

2 files changed

Lines changed: 8 additions & 10 deletions

File tree

src/auto-reply/reply/get-reply-inline-actions.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,7 @@ export type InlineActionResult =
7979
abortedLastRun: boolean;
8080
};
8181

82-
// oxlint-disable-next-line typescript/no-explicit-any
83-
function extractTextFromToolResult(result: any): string | null {
82+
function extractTextFromToolResult(result: unknown): string | null {
8483
if (!result || typeof result !== "object") {
8584
return null;
8685
}
@@ -246,12 +245,12 @@ export async function handleInlineActions(params: {
246245

247246
const toolCallId = `cmd_${generateSecureToken(8)}`;
248247
try {
249-
const result = await tool.execute(toolCallId, {
248+
const toolArgs: Parameters<NonNullable<typeof tool.execute>>[1] = {
250249
command: rawArgs,
251250
commandName: skillInvocation.command.name,
252251
skillName: skillInvocation.command.skillName,
253-
// oxlint-disable-next-line typescript/no-explicit-any
254-
} as any);
252+
};
253+
const result = await tool.execute(toolCallId, toolArgs);
255254
const text = extractTextFromToolResult(result) ?? "✅ Done.";
256255
typing.cleanup();
257256
return { kind: "reply", reply: { text } };

src/gateway/server.auth.shared.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -244,16 +244,16 @@ async function configureTrustedProxyControlUiAuth() {
244244

245245
async function writeTrustedProxyControlUiConfig(params?: { allowInsecureAuth?: boolean }) {
246246
const { writeConfigFile } = await import("../config/config.js");
247-
await writeConfigFile({
247+
const nextConfig: Parameters<typeof writeConfigFile>[0] = {
248248
gateway: {
249249
trustedProxies: ["127.0.0.1"],
250250
controlUi: {
251251
allowedOrigins: ["https://localhost"],
252252
...(params?.allowInsecureAuth ? { allowInsecureAuth: true } : {}),
253253
},
254254
},
255-
// oxlint-disable-next-line typescript/no-explicit-any
256-
} as any);
255+
};
256+
await writeConfigFile(nextConfig);
257257
}
258258

259259
function isConnectResMessage(id: string) {
@@ -325,8 +325,7 @@ async function startRateLimitedTokenServerWithPairedDeviceToken() {
325325
mode: "token",
326326
token: "secret",
327327
rateLimit: { maxAttempts: 1, windowMs: 60_000, lockoutMs: 60_000, exemptLoopback: false },
328-
// oxlint-disable-next-line typescript/no-explicit-any
329-
} as any;
328+
} satisfies Record<string, unknown>;
330329

331330
const { server, ws, port, prevToken } = await startServerWithClient(undefined, {
332331
controlUiEnabled: true,

0 commit comments

Comments
 (0)