@novedu/cli 0.18.0 → 0.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +50 -1
  2. package/dist/main.js +1351 -411
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -5,7 +5,8 @@ requires Node >= 20). It covers two jobs:
5
5
 
6
6
  - **Validate activity YAML** — tutors, fragment libraries, quizzes, writing
7
7
  activities, and coding activities — with the app's exact validation pipeline,
8
- offline and without signing in.
8
+ offline and without signing in. `prompts` dumps the exact system prompts an
9
+ activity produces, the same way.
9
10
  - **Manage the app as a teacher** — sign in with Microsoft Entra ID, then mint
10
11
  activity codes, upload app-hosted YAML files and images, and triage student
11
12
  reports, straight from the terminal (or from a coding agent, see below).
@@ -42,6 +43,54 @@ npx @novedu/cli validate ./my-quiz.yaml --kind quiz --json
42
43
  validates every fragment library it references.
43
44
  - Exit code `0` = valid, `1` = errors found — usable as a pre-commit / CI gate.
44
45
 
46
+ ## Seeing the exact prompts: `prompts`
47
+
48
+ `prompts` prints the **exact system prompts** an activity YAML produces — the
49
+ strings the app really sends to the model. Offline and sign-in-free, exactly like
50
+ `validate`.
51
+
52
+ ```bash
53
+ # A tutor's assembled system prompt (summary: kind, id, model, size per prompt)
54
+ npx @novedu/cli prompts ./activities/examples/sorting-algorithms/sorting-tutor.yaml
55
+
56
+ # A quiz: one grading prompt per question + the discussion prompt, full text as JSON
57
+ npx @novedu/cli prompts ./sorting-quiz.yaml --kind quiz --json
58
+
59
+ # A writing activity's coach prompt, a coding activity's injected system prompt
60
+ npx @novedu/cli prompts ./my-writing.yaml --kind writing
61
+ npx @novedu/cli prompts ./my-coding.yaml --kind coding
62
+
63
+ # A published activity by URL (same argument as `validate`)
64
+ npx @novedu/cli prompts https://raw.githubusercontent.com/Teaching-HTL-Leonding/novedu-chat-mvp/refs/heads/main/activities/examples/sorting-algorithms/sorting-tutor.yaml
65
+
66
+ # Pull out one question's grading prompt
67
+ npx @novedu/cli prompts ./sorting-quiz.yaml --kind quiz --json \
68
+ | jq -r '.grading.questions[] | select(.id=="q3") | .system'
69
+ ```
70
+
71
+ - The argument is a **local path or a public `http(s)` URL**, exactly like
72
+ `validate`'s; relative `fragment_files` / `quiz_files` / `text_files` resolve
73
+ against the activity's own location (sibling file, or sibling URL). "Offline"
74
+ means no app server, no database and no LLM call — not "no network".
75
+ - `--kind` accepts `tutor` (default), `quiz`, `writing` or `coding` — the same
76
+ caller-declared flag as `validate`. There is no `fragment` kind: a library has
77
+ no prompt of its own; its fragments appear **rendered in place** inside the
78
+ activity that places them.
79
+ - Every dump comes out of the app's own prompt builders and runtime loaders (no
80
+ re-implementation), so what you see is what the model gets: fragments resolved,
81
+ and — for a compound quiz — every `quiz_files` include fetched, each imported
82
+ question carrying its source quiz's preamble.
83
+ - Every dump carries `{ kind, id, llm: { provider, model } }`. A **quiz** adds
84
+ `grading` (a `system` prompt per question, the user-message templates and the
85
+ grader's JSON-Schema response contract) and `discussion` (the chat's `system`
86
+ prompt, the three seed-message templates and the verdict wording). A **coding**
87
+ activity also reports `upstreamSystemMessage` — what the proxy puts on the wire.
88
+ - The **activity's own** `llm` block is reported; a code's per-code LLM override
89
+ is not applied (a dump describes a file, and a file has no code).
90
+ - This runs the runtime load path, so a file that cannot be loaded exits `1` with
91
+ JSON errors on stderr. Use `validate` for the strict authoring check — the two
92
+ are complementary.
93
+
45
94
  ## Authentication
46
95
 
47
96
  Commands that talk to the running app authenticate with Microsoft Entra ID: