@plurnk/plurnk-grammar 0.68.0 → 0.71.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.
- package/README.md +2 -2
- package/dist/plurnk.gbnf +111 -538
- package/dist/src/AstBuilder.d.ts +2 -1
- package/dist/src/AstBuilder.d.ts.map +1 -1
- package/dist/src/AstBuilder.js +7 -1
- package/dist/src/AstBuilder.js.map +1 -1
- package/dist/src/PlurnkParser.d.ts +1 -0
- package/dist/src/PlurnkParser.d.ts.map +1 -1
- package/dist/src/PlurnkParser.js +30 -18
- package/dist/src/PlurnkParser.js.map +1 -1
- package/dist/src/generated/plurnkLexer.d.ts +7 -6
- package/dist/src/generated/plurnkLexer.d.ts.map +1 -1
- package/dist/src/generated/plurnkLexer.js +186 -180
- package/dist/src/generated/plurnkLexer.js.map +1 -1
- package/dist/src/generated/plurnkParser.d.ts +42 -29
- package/dist/src/generated/plurnkParser.d.ts.map +1 -1
- package/dist/src/generated/plurnkParser.js +414 -338
- package/dist/src/generated/plurnkParser.js.map +1 -1
- package/dist/src/generated/plurnkParserVisitor.d.ts +7 -0
- package/dist/src/generated/plurnkParserVisitor.d.ts.map +1 -1
- package/dist/src/generated/plurnkParserVisitor.js +6 -0
- package/dist/src/generated/plurnkParserVisitor.js.map +1 -1
- package/package.json +1 -1
- package/plurnk.md +1 -1
package/README.md
CHANGED
|
@@ -201,9 +201,9 @@ Errors are JSON-serializable. Shape: `{ line, column, source, message }` where `
|
|
|
201
201
|
|
|
202
202
|
One generated [GBNF](https://github.com/ggml-org/llama.cpp/blob/master/grammars/README.md) grammar ships for llama.cpp constrained sampling, calibrated for the Fireworks/DeepSeek backend:
|
|
203
203
|
|
|
204
|
-
- **`plurnk.gbnf` (PLAN-anchored turn)** — `root ::= preplan plan sep batch-step* send-final-any sep`. A Plurnk turn is a `*:PLAN:OPS:SEND[N]` sandwich: a FREE reasoning preamble
|
|
204
|
+
- **`plurnk.gbnf` (PLAN-anchored turn)** — `root ::= preplan plan sep batch-step* send-final-any sep`. A Plurnk turn is a `*:PLAN:OPS:SEND[N]` sandwich: a FREE **op-free** reasoning preamble, then a MANDATORY `<<PLAN` anchoring a strict ops-only batch (bounded `WS{0,7}` separators, no free prose between), closed by exactly one terminal `SEND[102|200|202|300|499]` — structural termination (forced EOS), not an optional stop a near-greedy decoder can sail past.
|
|
205
205
|
|
|
206
|
-
The preamble names **no reasoning delimiter** — it admits any text completing no `<<
|
|
206
|
+
The preamble names **no reasoning delimiter** — it admits any text completing no `<<OP` opener. That keeps it format-agnostic across models and never masks a model's native reasoning token: the model reasons freely (a reasoning model's CoT separates into `reasoning_content`; a non-reasoning model reasons in the `<<PLAN` body, the public statement of intent), then `<<PLAN` anchors the strict turn. The **ANTLR grammar enforces the same sandwich**: `PlurnkParser.parse(input)` parses a turn — free text before PLAN, a required PLAN, nothing but whitespace between/after ops, and a required terminal SEND; a packet without a PLAN *and* a terminal SEND is invalid. A Plurnk packet IS a turn — there is no permissive fallback. `PlurnkParser.parseStatements(input)` parses a bare statement sequence (teaching-example collections, single ops); it is not for model output.
|
|
207
207
|
|
|
208
208
|
```ts
|
|
209
209
|
import.meta.resolve("@plurnk/plurnk-grammar/plurnk.gbnf")
|