fix: resolve check errors in nodes-tool and commands-ptt

This commit is contained in:
Shakker
2026-02-02 20:05:17 +00:00
parent 7113dc21a9
commit d3bb32273e
2 changed files with 4 additions and 5 deletions

View File

@@ -454,7 +454,9 @@ export function createNodesTool(options?: {
invokeParams = JSON.parse(invokeParamsJson);
} catch (err) {
const message = err instanceof Error ? err.message : String(err);
throw new Error(`invokeParamsJson must be valid JSON: ${message}`);
throw new Error(`invokeParamsJson must be valid JSON: ${message}`, {
cause: err,
});
}
}
const invokeTimeoutMs = parseTimeoutMs(params.invokeTimeoutMs);

View File

@@ -187,10 +187,7 @@ export const handlePTTCommand: CommandHandler = async (params, allowTextCommands
params: invokeParams,
config: cfg,
});
const payload =
res.payload && typeof res.payload === "object"
? (res.payload as Record<string, unknown>)
: {};
const payload = res.payload && typeof res.payload === "object" ? res.payload : {};
const lines = [`PTT ${actionKey}${nodeId}`];
if (typeof payload.status === "string") {