feat(signals): discover installed decoders and option help (#2487)

* feat(signals): discover installed decoders and selected option help

* fix(signals): bound retained discovery data and preserve resource failures

* fix(signals): complete CLI help and portable decoder patterns

* test(signals): verify case-insensitive decoder help queries

* fix(signals): retain discovery operation across cleanup retries
This commit is contained in:
Olorin
2026-10-13 15:58:19 +09:00
committed by GitHub
parent 9c34c091b3
commit 4276aaf18b
18 changed files with 945 additions and 173 deletions
@@ -1,3 +1,7 @@
import {
inspectSignalDecodersInputSchema,
signalDecodersSchema,
} from "../../domain/signals/signalDecoders.js";
import {
decodeSignalRecordingInputSchema,
signalRecordingSchema,
@@ -6,6 +10,22 @@ import type { ToolContract } from "../toolContractTypes.js";
import { toolContractMetadata } from "../toolEffects.js";
import { evidenceResultOf } from "../toolOutputSchemaPrimitives.js";
export const SIGNAL_TOOL_CONTRACTS = [
{
name: "inspect_signal_decoders",
...toolContractMetadata("inspect_signal_decoders"),
kind: "artifact-provider",
description:
"Discover installed sigrok protocol decoders or inspect one decoder's channel/option help on Linux. Omit decoder to list ID/name pairs; supply its exact ID for literal help lines with source line numbers. query is a case-insensitive literal substring. Page matches with offset/limit (default 50; null returns all remaining). Reports tool identity, version, diagnostics and examined/matching coverage. Uses configured REA_SIGROK_COMMAND and prlimit; no recording, binary target, hardware scan or acquisition. Each call probes again; decoder modules are trusted, not fully fingerprinted. Use returned IDs/options with decode_signal_recording.",
inputSchema: inspectSignalDecodersInputSchema,
outputSchema: evidenceResultOf(signalDecodersSchema),
examples: [
{ title: "Find installed UART decoders", input: { query: "uart" } },
{
title: "Read the installed UART baud-rate option",
input: { decoder: "uart", query: "baud" },
},
],
},
{
name: "decode_signal_recording",
...toolContractMetadata("decode_signal_recording"),
+5
View File
@@ -69,6 +69,11 @@ export const TOOL_EFFECTS: Readonly<Record<string, ToolEffects>> = {
launchesProcess: true,
writesFilesystem: true,
}),
inspect_signal_decoders: effects({
mutatesSession: true,
launchesProcess: true,
writesFilesystem: true,
}),
decode_signal_recording: effects({
mutatesSession: true,
launchesProcess: true,