Skip to contents

Natural-Language Specification Composer Shiny Module (Server)

Usage

mod_spec_composer_server(
  id,
  spec_rv,
  translator = translator_rule(),
  last_diff_rv = NULL
)

Arguments

id

Module namespace ID.

spec_rv

A shiny::reactiveVal holding the current validated spec_ir (shared across composer, controls, and preview modules).

translator

A spec_translator backend (defaults to translator_rule()).

last_diff_rv

Optional shiny::reactiveVal holding the latest spec_diff.

Value

A list of reactive accessors (spec, diff, clarifications, status, history).

Examples

spec_rv <- shiny::reactiveVal(NULL)
shiny::testServer(
  mod_spec_composer_server,
  args = list(spec_rv = spec_rv),
  {
    session$setInputs(prompt = "Single-level study N = 150", compile = 1)
    spec_rv()$hierarchy$n_obs
  }
)
#> Loading required package: shiny