fix(inspector): preserve lossy Node discovery locations (#542)
Keep explicitly selected Node Inspector targets observable when discovery cannot verify their file location. Resolve literal POSIX discovery paths without URI decoding, and retain lossy Windows or underscore paths as unresolved metadata. Validate scriptParsed file URLs independently. Preserve unknown target identity through runtime reconciliation, regenerate contracts, and verify real CLI/MCP behavior on Linux and Windows. Closes #530 Assisted-by: Kogasa (gensokyo-skills:kogasa-surprise-testing)
This commit is contained in:
@@ -64,11 +64,27 @@ export type JavaScriptRuntimeLocation = z.infer<
|
||||
typeof javascriptRuntimeLocationSchema
|
||||
>;
|
||||
|
||||
/** Discovery metadata can identify an endpoint target without verifying its file location. */
|
||||
export const javascriptRuntimeUnresolvedLocationSchema = z.strictObject({
|
||||
kind: z.literal("unresolved"),
|
||||
reported_url: z.string().min(1),
|
||||
reason: z.literal("unverifiable-file-location"),
|
||||
});
|
||||
|
||||
/** Verified locations and explicitly unresolved discovery metadata. */
|
||||
export const javascriptRuntimeTargetLocationSchema = z.union([
|
||||
javascriptRuntimeLocationSchema,
|
||||
javascriptRuntimeUnresolvedLocationSchema,
|
||||
]);
|
||||
export type JavaScriptRuntimeTargetLocation = z.infer<
|
||||
typeof javascriptRuntimeTargetLocationSchema
|
||||
>;
|
||||
|
||||
const javascriptRuntimeTargetSchema = z.strictObject({
|
||||
target_id: z.string().min(1),
|
||||
protocol_type: z.string().min(1),
|
||||
attached: z.boolean(),
|
||||
location: javascriptRuntimeLocationSchema,
|
||||
location: javascriptRuntimeTargetLocationSchema,
|
||||
});
|
||||
|
||||
/** Complete V8 Inspector target inventory exposed by the selected endpoint. */
|
||||
|
||||
Reference in New Issue
Block a user