@plurnk/plurnk-contracts 1.16.5 → 1.18.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 +13 -62
- package/SPEC.md +633 -529
- package/dist/conformance/agui-v1.json +3 -50
- package/dist/schema/CapabilityDescriptor.json +6 -1
- package/dist/schema/CapabilityProjection.json +2 -4
- package/dist/schema/CapabilitySelector.json +6 -1
- package/dist/schema/ClientStatement.json +5 -52
- package/dist/schema/FunctionalityDefinitionState.json +10 -2
- package/dist/schema/LineMarker.json +1 -1
- package/dist/schema/LoopPolicy.json +2 -3
- package/dist/schema/MatcherBody.json +6 -6
- package/dist/schema/McpServerDefinition.json +17 -0
- package/dist/schema/ModelCatalogPage.json +10 -1
- package/dist/schema/ModelRoute.json +9 -0
- package/dist/schema/Notice.json +1 -1
- package/dist/schema/ParsedPath.json +3 -2
- package/dist/schema/Plan.json +10 -6
- package/dist/schema/PlurnkStatement.json +95 -143
- package/dist/schema/ProposalProjection.json +6 -1
- package/dist/schema/ResourceSelection.json +51 -27
- package/dist/schema/SkillDefinition.json +3 -3
- package/dist/src/AcpPlanValue.d.ts +0 -1
- package/dist/src/AcpPlanValue.d.ts.map +1 -1
- package/dist/src/AcpPlanValue.js +14 -13
- package/dist/src/AcpPlanValue.js.map +1 -1
- package/dist/src/ApplicationPort.d.ts +17 -14
- package/dist/src/ApplicationPort.d.ts.map +1 -1
- package/dist/src/JsonDocument.d.ts +2 -0
- package/dist/src/JsonDocument.d.ts.map +1 -0
- package/dist/src/JsonDocument.js +14 -0
- package/dist/src/JsonDocument.js.map +1 -0
- package/dist/src/LoopLifecycle.d.ts +3 -0
- package/dist/src/LoopLifecycle.d.ts.map +1 -0
- package/dist/src/LoopLifecycle.js +14 -0
- package/dist/src/LoopLifecycle.js.map +1 -0
- package/dist/src/PlanValue.d.ts +1 -1
- package/dist/src/PlanValue.d.ts.map +1 -1
- package/dist/src/PlanValue.js +10 -6
- package/dist/src/PlanValue.js.map +1 -1
- package/dist/src/PlurnkParseError.d.ts +3 -1
- package/dist/src/PlurnkParseError.d.ts.map +1 -1
- package/dist/src/PlurnkParseError.js +4 -1
- package/dist/src/PlurnkParseError.js.map +1 -1
- package/dist/src/TurnDisposition.d.ts +11 -0
- package/dist/src/TurnDisposition.d.ts.map +1 -0
- package/dist/src/TurnDisposition.js +32 -0
- package/dist/src/TurnDisposition.js.map +1 -0
- package/dist/src/Validator.js +1 -1
- package/dist/src/Validator.js.map +1 -1
- package/dist/src/index.d.ts +5 -4
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +5 -5
- package/dist/src/index.js.map +1 -1
- package/dist/src/types.d.ts +13 -8
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/types.generated.d.ts +172 -86
- package/dist/src/types.generated.d.ts.map +1 -1
- package/dist/src/types.js +9 -4
- package/dist/src/types.js.map +1 -1
- package/package.json +5 -23
- package/plurnk.md +106 -119
- package/bin/plurnk-contracts.js +0 -43
- package/dist/plurnk.gemma.gbnf +0 -141
- package/dist/plurnk.qwen.gbnf +0 -130
- package/dist/src/AstBuilder.d.ts +0 -20
- package/dist/src/AstBuilder.d.ts.map +0 -1
- package/dist/src/AstBuilder.js +0 -723
- package/dist/src/AstBuilder.js.map +0 -1
- package/dist/src/PlurnkErrorStrategy.d.ts +0 -11
- package/dist/src/PlurnkErrorStrategy.d.ts.map +0 -1
- package/dist/src/PlurnkErrorStrategy.js +0 -358
- package/dist/src/PlurnkErrorStrategy.js.map +0 -1
- package/dist/src/PlurnkParser.d.ts +0 -11
- package/dist/src/PlurnkParser.d.ts.map +0 -1
- package/dist/src/PlurnkParser.js +0 -335
- package/dist/src/PlurnkParser.js.map +0 -1
- package/dist/src/RecordingListener.d.ts +0 -9
- package/dist/src/RecordingListener.d.ts.map +0 -1
- package/dist/src/RecordingListener.js +0 -19
- package/dist/src/RecordingListener.js.map +0 -1
- package/dist/src/generated/plurnkLexer.d.ts +0 -174
- package/dist/src/generated/plurnkLexer.d.ts.map +0 -1
- package/dist/src/generated/plurnkLexer.js +0 -1215
- package/dist/src/generated/plurnkLexer.js.map +0 -1
- package/dist/src/generated/plurnkParser.d.ts +0 -477
- package/dist/src/generated/plurnkParser.d.ts.map +0 -1
- package/dist/src/generated/plurnkParser.js +0 -3298
- package/dist/src/generated/plurnkParser.js.map +0 -1
- package/dist/src/generated/plurnkParserVisitor.d.ts +0 -284
- package/dist/src/generated/plurnkParserVisitor.d.ts.map +0 -1
- package/dist/src/generated/plurnkParserVisitor.js +0 -245
- package/dist/src/generated/plurnkParserVisitor.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @plurnk/plurnk-contracts
|
|
2
2
|
|
|
3
|
-
The single authority for PLURNK's model-facing language,
|
|
3
|
+
The single authority for PLURNK's model-facing language contract, its AST,
|
|
4
4
|
generated model rail, shared schemas and types, runtime-neutral Problems,
|
|
5
5
|
operation results, Notices, and text coordinates. See SPEC
|
|
6
6
|
{§contract-authority}.
|
|
@@ -19,45 +19,23 @@ Requires Node.js 26 or newer.
|
|
|
19
19
|
|---------------------------------|------------------------------------------------------|
|
|
20
20
|
| Concise model language teaching | [`plurnk.md`](plurnk.md) |
|
|
21
21
|
| Stable behavioral contract | [`SPEC.md`](SPEC.md) |
|
|
22
|
-
| Accepted language syntax | `
|
|
22
|
+
| Accepted language syntax | `SPEC.md` ({§contract-layers}); implemented by `@plurnk/plurnk-parser` |
|
|
23
23
|
| Shared wire shapes | `schema/*.json` |
|
|
24
24
|
| JavaScript and TypeScript API | `@plurnk/plurnk-contracts` |
|
|
25
25
|
| Published JSON Schemas | `@plurnk/plurnk-contracts/schema/*.json` |
|
|
26
|
-
| Optional local-model rails | `@plurnk/plurnk-contracts/plurnk.{gemma,qwen}.gbnf` |
|
|
27
26
|
|
|
28
27
|
JSON Schema owns shared wire shapes, generated TypeScript projects those
|
|
29
|
-
shapes, ANTLR owns accepted model-language syntax
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
shapes, and ANTLR owns accepted model-language syntax. See SPEC
|
|
29
|
+
{§contract-representations}. An operator who wants constrained sampling on a
|
|
30
|
+
llama-server route writes their own GBNF and points `PLURNK_PROVIDERS_GBNF` at
|
|
31
|
+
it; this package ships no grammar profile.
|
|
32
32
|
|
|
33
33
|
## Parser
|
|
34
34
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
for (const item of result.items) {
|
|
41
|
-
if (item.kind === "statement") {
|
|
42
|
-
console.log(item.statement.op);
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
Parse items are ordered and discriminate as `statement`, `error`, or `text`.
|
|
48
|
-
The parser entry points deliberately accept different document tiers:
|
|
49
|
-
|
|
50
|
-
| Entry point | Accepted input |
|
|
51
|
-
|--------------------------------|-------------------------------------------------------|
|
|
52
|
-
| `PlurnkParser.parse` | One operation-bearing model turn; omitted PLAN/SEND are recovered |
|
|
53
|
-
| `PlurnkParser.parseStatements` | A strict sequence of protocol statements |
|
|
54
|
-
| `PlurnkParser.parseLog` | Strict consecutive PLAN-through-SEND turns |
|
|
55
|
-
| `PlurnkParser.parseClient` | Protocol statements plus client-only LOOK and BUFF |
|
|
56
|
-
| `parsePath` | One path or URI using parser-equivalent decomposition |
|
|
57
|
-
|
|
58
|
-
See SPEC {§turn-shape} and {§tier-entrypoints} for the tier boundaries. All
|
|
59
|
-
AST, parse-result, schema-derived, and runtime-neutral wire types are exported
|
|
60
|
-
from the package root.
|
|
35
|
+
The parser that implements this language is [`@plurnk/plurnk-parser`](../plurnk-parser):
|
|
36
|
+
`PlurnkParser` and `parsePath` are its exports, and it depends on this package for
|
|
37
|
+
the AST and wire types. A consumer that validates or presents the wire needs only
|
|
38
|
+
this package.
|
|
61
39
|
|
|
62
40
|
## Wire validation
|
|
63
41
|
|
|
@@ -78,33 +56,6 @@ Generated wire types, constructors, and validators share the package root entry
|
|
|
78
56
|
point described by SPEC {§wire-entrypoint}. Owning JSON Schemas use the published
|
|
79
57
|
`@plurnk/plurnk-contracts/schema/*.json` subpaths.
|
|
80
58
|
|
|
81
|
-
## CLI
|
|
82
|
-
|
|
83
|
-
```text
|
|
84
|
-
plurnk-contracts [file] parse a file, or standard input when omitted
|
|
85
|
-
plurnk-contracts --help show usage
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
The CLI prints the parse result as JSON and exits `0` for a clean parse or `1`
|
|
89
|
-
when the result contains an error or unparsed tail.
|
|
90
|
-
|
|
91
|
-
## Optional GBNF artifact
|
|
92
|
-
|
|
93
|
-
```ts
|
|
94
|
-
const railUrl = import.meta.resolve(
|
|
95
|
-
"@plurnk/plurnk-contracts/plurnk.qwen.gbnf",
|
|
96
|
-
);
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
Choose `gemma` when the model generates its complete
|
|
100
|
-
`<|channel>thought … <channel|>` enclosure, or `qwen` when the chat template
|
|
101
|
-
supplies `<think>\n` before sampled token zero. The latter artifact is named
|
|
102
|
-
`qwen` because that prefill is Qwen's template protocol, not a general property
|
|
103
|
-
of think tags. Both constrain the same PLURNK
|
|
104
|
-
turn after reasoning. They are not second parsers and do not guarantee
|
|
105
|
-
semantically valid output. See SPEC {§gbnf-turn-shape} and
|
|
106
|
-
{§gbnf-reasoning-boundary}.
|
|
107
|
-
|
|
108
59
|
## Development
|
|
109
60
|
|
|
110
61
|
```sh
|
|
@@ -113,9 +64,9 @@ npm test
|
|
|
113
64
|
npm run test:installation
|
|
114
65
|
```
|
|
115
66
|
|
|
116
|
-
Generated
|
|
117
|
-
|
|
118
|
-
|
|
67
|
+
Generated schema-type and distribution artifacts are rebuilt by `npm run build`.
|
|
68
|
+
Change the owning schema rather than editing generated output directly; the
|
|
69
|
+
grammar and its generated parser live in `@plurnk/plurnk-parser`.
|
|
119
70
|
|
|
120
71
|
## License
|
|
121
72
|
|