refactor: remove dead code (parseJsonRaw, stale re-exports) (#2246)

- Remove parseJsonRaw from packages/shared — exported but never imported
- Remove dead re-exports from agent-setup.ts (AgentConfig type, generateEnvConfig)
  that no consumer imports (all callers use the original modules directly)

Co-authored-by: spawn-qa-bot <qa@openrouter.ai>
This commit is contained in:
A 2026-03-06 08:49:26 -08:00 committed by GitHub
parent 4ac19a375a
commit 8b99fe0a37
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 1 additions and 19 deletions

View file

@ -32,11 +32,6 @@ export async function wrapSshCall(op: Promise<void>): Promise<Result<void>> {
}
}
// Re-export so cloud modules can re-export from here
export type { AgentConfig };
export { generateEnvConfig } from "./agents";
// ─── CloudRunner interface ──────────────────────────────────────────────────
export interface CloudRunner {

View file

@ -1,3 +1,3 @@
export { parseJsonObj, parseJsonRaw, parseJsonWith } from "./parse";
export { parseJsonObj, parseJsonWith } from "./parse";
export { Err, Ok, type Result } from "./result";
export { hasMessage, hasStatus, isNumber, isString, toObjectArray, toRecord } from "./type-guards";

View file

@ -17,19 +17,6 @@ export function parseJsonWith<T extends v.BaseSchema<unknown, unknown, v.BaseIss
}
}
/**
* Escape hatch: parse JSON to `unknown` without schema validation.
* Use for dynamic response formats where a fixed schema isn't practical
* (e.g., cloud APIs with 5+ response shapes).
*/
export function parseJsonRaw(text: string): unknown {
try {
return JSON.parse(text);
} catch {
return null;
}
}
/**
* Parse a JSON string and return it as a Record<string, unknown> or null.
* Rejects non-object results (arrays, primitives).