typst not reconized as a valid format in yalm of .qmd file

Dear Posit community,
I'm very interested in using typst to make pdf reports, however typst seems not to be reconized on my computer. I don't understand where the problem is and did't find any related topics on the web.
My best hypothesis is that my OS, R or Rstudio version are too old to support typst, but I didn't find information to confirm this.

This exemple...

---
title: "My document"
format: typst
---

## Hello

...return the following error when rendering

ERROR: Validation of YAML front matter failed.
ERROR: In file TEST_Typst_doc.qmd
(line 3, columns 9--13) Field "format" has value typst, which must instead be 'asciidoc'
2: title: "My document"
3: format: typst
          ~~~~~
4: ---

ERROR: Render failed due to invalid YAML.

My R studio and OS version

> sessionInfo()
R version 4.3.2 (2023-10-31)
Platform: x86_64-apple-darwin20 (64-bit)
Running under: macOS Big Sur 11.7.10
Rstudio Version 2023.09.1+494 (2023.09.1+494)

Any ideas or suggestions ?

What version of Quarto do you have installed? This same error was also reported in VS Code and the OP reported having two conflicting installs of Quarto. Maybe you have something similar going on. I use Typst with Quarto now for PDFs (as I've also started using Typst a lot on its own) and I'm not having any trouble, but I'm running RStudio 2024.09.1+394, R version 4.4.1 (2024-06-14), and quarto R package 1.4.4.9003. I have typst 0.12.0 installed and the quarto_cli quarto_cli 1.5.57 via homebrew.

Hello Eric, thanks for your answer,

In RStudio getNamespaceVersion("quarto") return :

version 
"1.4.4"

and
quarto_version() [1] ‘1.0.38’

I that possible that RStudio load 1.4.4 but use an old version? Or a version loaded in anaconda 3 or VS Code?

EDIT:
This is maybe a confusion between quarto CLI and quarto R package, quarto_version()returning the version of CLI.

So the question remain how I update the quarto CLI in RStudio. If this is a bundle of RStudio I cannot upgrade, so do I have to install another version of quarto and change the R PATH?

EDIT:
Installed quarto version 1.5.57. RStudio use this version by defaut whitout need to specify the path. So far so good. However I have another error message when trying to render my quarto file with typstformat:

pandoc 
  to: typst
  output-file: TEST_Typst_doc.typ
  standalone: true
  shift-heading-level-by: -1
  default-image-extension: svg
  wrap: none
  citeproc: false
  
metadata
  title: My document
  
[typst]: Compiling TEST_Typst_doc.typ to TEST_Typst_doc.pdf...dyld: Library not loaded: /usr/local/opt/xz/lib/liblzma.5.dylib
  Referenced from: /Applications/quarto/bin/tools/x86_64/typst
  Reason: no suitable image found.  Did find:
	/usr/local/opt/xz/lib/liblzma.5.dylib: code signature in (/usr/local/opt/xz/lib/liblzma.5.dylib) not valid for use in process using Library Validation: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.

The same error appears when runing quarto check in the terminal

Quarto 1.5.57
[✓] Checking versions of quarto binary dependencies...
      Pandoc version 3.2.0: OK
      Dart Sass version 1.70.0: OK
      Deno version 1.41.0: OK
dyld: Library not loaded: /usr/local/opt/xz/lib/liblzma.5.dylib
  Referenced from: /Applications/quarto/bin/tools/x86_64/typst
  Reason: no suitable image found.  Did find:
        /usr/local/opt/xz/lib/liblzma.5.dylib: code signature in (/usr/local/opt/xz/lib/liblzma.5.dylib) not valid for use in process using Library Validation: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.
[✓] Checking versions of quarto dependencies......OK
[✓] Checking Quarto installation......OK
      Version: 1.5.57
      Path: /Applications/quarto/bin

error: Uncaught (in promise) Error: Unable to determine Typst version
            throw new Error(`Unable to determine ${name} version`);
                  ^
    at checkVersion (file:///Applications/quarto/bin/quarto.js:101084:19)
    at checkVersions (file:///Applications/quarto/bin/quarto.js:101125:5)
    at eventLoopTick (ext:core/01_core.js:153:7)
    at async check (file:///Applications/quarto/bin/quarto.js:101066:13)
    at async Command.actionHandler (file:///Applications/quarto/bin/quarto.js:101389:5)
    at async Command.execute (file:///Applications/quarto/bin/quarto.js:8017:13)
    at async Command.parseCommand (file:///Applications/quarto/bin/quarto.js:7907:20)
    at async quarto (file:///Applications/quarto/bin/quarto.js:118224:9)
    at async file:///Applications/quarto/bin/quarto.js:118244:9
    at async mainRunner (file:///Applications/quarto/bin/quarto.js:118128:9)

Typstseems to be the problem.

You might need to install xz with Homebrew. When I do brew search for liblzma it returns:

If you meant "liblzma" specifically:
lzma is now part of the xz formula:
brew install xz

Though I found these two issues/discussion around the quarto-cli and it might be solved by a reinstall. It looked like, from some comments, it had to do with which version of typst quarto was choosing to use.

I installed xz via homebrew but the problem remain the same. Installing another version of Typstwith homebrew failed too. At least this is a step further to identify the problem has being the same as

I will follow update on this thread. Thanks @Eric-hunt for your answers.