refactor(tools): remove remaining arbitrary workflow caps

This commit is contained in:
morluto
2026-09-29 17:00:06 +08:00
parent 4ad937c6ca
commit ecf3ed8bdb
43 changed files with 230 additions and 393 deletions
-1
View File
@@ -435,7 +435,6 @@ export class GhidraClient {
stream: event.stream,
bytes: event.bytes,
totalBytes: event.totalBytes,
truncated: event.truncated,
});
return;
}
-1
View File
@@ -22,7 +22,6 @@ export type GhidraDiagnostic =
readonly stream: "stdout" | "stderr";
readonly bytes: number;
readonly totalBytes: number;
readonly truncated: boolean;
}
| {
readonly type: "launcher-exit";
-2
View File
@@ -77,6 +77,4 @@ const boundedStream = (
): JsonValue => ({
text: redact(stream.text),
bytes: stream.bytes,
retained_bytes: stream.retainedBytes,
truncated: stream.truncated,
});
+4 -10
View File
@@ -3,7 +3,7 @@ import { access, open } from "node:fs/promises";
import { err, ok, type Result } from "../domain/result.js";
import { GhidraSessionError } from "./GhidraSessionError.js";
/** Local bridge transports admitted by the versioned session descriptor. */
/** Local bridge transports used by the current Ghidra session. */
export type GhidraTransportKind = "unix-socket" | "authenticated-loopback-tcp";
/** Private runtime coordinate used to discover one bridge listener. */
@@ -17,8 +17,6 @@ export type GhidraConnectTarget =
| { readonly path: string }
| { readonly host: "127.0.0.1"; readonly port: number };
const MAX_ENDPOINT_BYTES = 1024;
/** Observe a ready endpoint, returning null while its bridge is not listening. */
export const observeGhidraEndpoint = async (
endpoint: GhidraEndpoint,
@@ -54,14 +52,10 @@ export const observeGhidraEndpoint = async (
);
}
try {
const bytes = Buffer.alloc(MAX_ENDPOINT_BYTES + 1);
const observed = await handle.read(bytes, 0, bytes.length, 0);
if (observed.bytesRead === 0 || observed.bytesRead > MAX_ENDPOINT_BYTES)
const encoded = await handle.readFile("utf8");
if (encoded.length === 0)
return err(endpointFailure(endpoint, "Ghidra TCP endpoint is invalid"));
return parseTcpEndpoint(
endpoint,
bytes.subarray(0, observed.bytesRead).toString("utf8"),
);
return parseTcpEndpoint(endpoint, encoded);
} catch (cause: unknown) {
return err(endpointFailure(endpoint, "Ghidra endpoint read failed", cause));
} finally {
+2 -2
View File
@@ -14,8 +14,8 @@ const responseSchema = z.discriminatedUnion("ok", [
ok: z.literal(false),
error: z
.object({
code: z.string().min(1).max(128),
message: z.string().min(1).max(4_096),
code: z.string().min(1),
message: z.string().min(1),
})
.strict(),
}),