chore: Fix TypeScript errors 4/n.

main
cpojer 2026-01-31 16:48:44 +09:00
parent 3282d22dd9
commit 9e908ad6be
No known key found for this signature in database
GPG Key ID: C29F94A3201118AF
3 changed files with 15 additions and 5 deletions

View File

@ -369,7 +369,12 @@ export async function runSubagentAnnounceFlow(params: {
let outcome: SubagentRunOutcome | undefined = params.outcome; let outcome: SubagentRunOutcome | undefined = params.outcome;
if (!reply && params.waitForCompletion !== false) { if (!reply && params.waitForCompletion !== false) {
const waitMs = Math.min(params.timeoutMs, 60_000); const waitMs = Math.min(params.timeoutMs, 60_000);
const wait = await callGateway({ const wait = await callGateway<{
status?: string;
startedAt?: number;
endedAt?: number;
error?: string;
}>({
method: "agent.wait", method: "agent.wait",
params: { params: {
runId: params.childRunId, runId: params.childRunId,

View File

@ -322,7 +322,12 @@ export function registerSubagentRun(params: {
async function waitForSubagentCompletion(runId: string, waitTimeoutMs: number) { async function waitForSubagentCompletion(runId: string, waitTimeoutMs: number) {
try { try {
const timeoutMs = Math.max(1, Math.floor(waitTimeoutMs)); const timeoutMs = Math.max(1, Math.floor(waitTimeoutMs));
const wait = await callGateway({ const wait = await callGateway<{
status?: string;
startedAt?: number;
endedAt?: number;
error?: string;
}>({
method: "agent.wait", method: "agent.wait",
params: { params: {
runId, runId,

View File

@ -9,7 +9,7 @@ export async function readLatestAssistantReply(params: {
sessionKey: string; sessionKey: string;
limit?: number; limit?: number;
}): Promise<string | undefined> { }): Promise<string | undefined> {
const history = await callGateway({ const history = await callGateway<{ messages: Array<unknown> }>({
method: "chat.history", method: "chat.history",
params: { sessionKey: params.sessionKey, limit: params.limit ?? 50 }, params: { sessionKey: params.sessionKey, limit: params.limit ?? 50 },
}); });
@ -27,7 +27,7 @@ export async function runAgentStep(params: {
lane?: string; lane?: string;
}): Promise<string | undefined> { }): Promise<string | undefined> {
const stepIdem = crypto.randomUUID(); const stepIdem = crypto.randomUUID();
const response = await callGateway({ const response = await callGateway<{ runId?: string }>({
method: "agent", method: "agent",
params: { params: {
message: params.message, message: params.message,
@ -44,7 +44,7 @@ export async function runAgentStep(params: {
const stepRunId = typeof response?.runId === "string" && response.runId ? response.runId : ""; const stepRunId = typeof response?.runId === "string" && response.runId ? response.runId : "";
const resolvedRunId = stepRunId || stepIdem; const resolvedRunId = stepRunId || stepIdem;
const stepWaitMs = Math.min(params.timeoutMs, 60_000); const stepWaitMs = Math.min(params.timeoutMs, 60_000);
const wait = await callGateway({ const wait = await callGateway<{ status?: string }>({
method: "agent.wait", method: "agent.wait",
params: { params: {
runId: resolvedRunId, runId: resolvedRunId,