If I understand your requirements correctly, the following solves the problem:
#let meta = (
name: "note1",
uuid: "rupiv",
)
// this has to be a function. If it wasn't,
// there'd be a cyclic import preventing this from working
#let body() = {
let body = include "note.typ"
// the whole file is a sequence, and the last item is what
// the `show: ...` rule makes out of the actual content
let body = body.children.last()
// we can assure that the first item in that sequence
// will be a metadata element containing the raw body
let body = body.children.first().value
body
}
#show: body => {
// this has to be the first thing
// be sure to use `{...}` instead of `[...]` to avoid spaces
metadata(body)
[= Note]
set text(red)
body
}
Note contents
#import "note.typ": meta, body
#include "note.typ"
#body()
I tried to use an example show rule that is sufficiently complex (it styles and also adds content to the raw body). That means that the actual raw body could be nested deep inside what the show rule produces, but by placing some metadata in the beginning we can circumvent any complications and (hopefully) reliably find the raw content.